Does Every Developer Know This MDN Trick? I Hope So.

If you have a question about how anything works in javascript, whether it be a method or a type or whatever, type in your browser bar, with "thing" being a keyword that would probably point to the documentation page you need.

This will run a search on MDN (Mozilla Developer Network) for a page that fits that "thing" you asked about and immediately take you to the page, much like Google's "I'm Feeling Lucky" button (which I used to thing was some kind of internet gambling button).

Examples: takes you to the page about Array.prototype. That's not the actual url for that page, but what do you care! You got there none the less. takes you to a page defining the Array.prototype's slice method. takes you to the page defining the floor method on the Math prototype.

I used to have to search for javascript documentation by typing "mdn array slice" or something like that into google or my browser bar, then select a result to get to the desired page.

Now there's no search at all. With I feel like I have all the urls I need memorized.

MDN vs. W3 Schools

If you're wondering about why my default search for javascript explanations is on MDN instead of W3 Schools, here is the reason. W3 Schools is handy in a pinch, or in times when the MDN explanation is hard to understand or doesn't have a good example. But I have heard that W3 schools also sometimes teaches bad practices in their examples. I'm not an experienced enough developer to know what those are, but even I can tell that MDN is much more thorough at the very least.

Plus MDN doesn't have any ads. So even though it is a little more intimidating than W3 Schools, do yourself a favor and start getting used to looking things up on MDN. Especially now that you know the trick, you'll be glad you did.

Written on December 24, 2015