r/javascript • • Sep 06 '12

JavaScript Tricks You May Not Know

http://www.learncomputer.com/javascript-tricks-you-may-not-know/
0 Upvotes

14 comments sorted by

View all comments

3

u/bart2019 Sep 06 '12

The dude should try to avoid words collapsed together, like

varmyVariable;
deletesomeObj.val;

which should have been

var myVariable;
delete someObj.val;

3

u/kristopolous Sep 06 '12 edited Sep 06 '12

agreed. It's totally sloppy. And these are all things that someone with a thorough JS education should know.

Here's an example of something this could have been, in firefox, try this:

function debugger() { alert ("hello world"); }
debugger();

Or the fact that the javascript duck typing can be overloaded. That's something most people actually don't know.

-1

u/samplebitch Sep 06 '12

duck typing?

0

u/[deleted] Sep 06 '12

[deleted]

1

u/mgoulart Sep 06 '12

Don't be that guy. Link him directly to it: http://lmgtfy.com/?q=duck+typing