Modernizr/Modernizr — comment on commit c56fb8b09515f629806ca44742932902ac145302
File: feature-detects/network-connection.js line 22
By mathiasbynens:

Shouldn’t this be `connection` instead of `navigator.connection`?

Also, if you need a boolean anyway you might as well use `.test()`: `/^(?:2g|3g)$/.test(connection.type)`. This should be faster, too!