Link Details

Link 961411 thumbnail
User 990299 avatar

By Kennethtruyers
via kenneth-truyers.net
Submitted: Apr 27 2013 / 18:28

Although Namespaces don't technically exist in JavaScript we can still create something similar. Modules provide scoping and allow modular application design.
  • 2
  • 1
  • 475
  • 98

Comments

Add your comment
User 368023 avatar

yakkoh replied ago:

0 votes Vote down Vote up Reply

The line "var MAYAPPLICATION = MYAPPLICATION || {};" is not a capital crime against clarity and logic, but JS should have an operator this initialization. I have never seen such a construct in any language. All explain here: http://addyosmani.com/blog/exploring-javascripts-logical-or-operator/

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)



Voters Against This Link (1)



Apache Hadoop
Written by: Piotr Krewski
Featured Refcardz: Top Refcardz:
  1. Play
  2. Akka
  3. Design Patterns
  4. OO JS
  5. Cont. Delivery
  1. Play
  2. Java Performance
  3. Akka
  4. REST
  5. Java