If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Monday, November 9, 2009

Advanced Javascript: part 2

A common mistake (?) often seen is people declaring like a zillion GLOBAL variables in their scripts. That might not cause any problems when relying on only 1 script in your page but it will become a problem for sure when you include scripts from colleagues which contain variables with the same name.

RULE 1: always use namespaces in your scripts

Of course i followed this rule as the image below shows.

No comments:

Post a Comment