Show Love to the Object Literal | Core JavaScript 1.5 Guide:Literals

Defining an object is via literal notation. Supported in JavaScript1.2 and above, it’s a more robust form of creating an object on the fly.
Neat and clean approach to write reusable, readable and maintainable JavaScript code.

Show Love to the Object Literal:
http://ajaxian.com/archives/show-love-to-the-object-literal

Object literals beauty lies in Namespaces, which reduces the number of global variables in your pages. It uses a technique known as branching, which allows you to use common utility
functions without worrying about browser sniffing.

That’s where Singleton Design Pattern comes into the picture, as far as I know, it is the most widely use design pattern these days in JavaScript world.

Using global variables in your page presents a huge risk, and a namespace created with a singleton is one of the best ways to remove those global variables. I stuck many times using global variables and also consume good amount of memory.

Core JavaScript 1.5 Guide:Literals [Some basics of literals]:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Literals

Share and Enjoy:
  • Twitter
  • Facebook
  • del.icio.us
  • Print
  • Live
  • Digg
  • Sphinn
  • Mixx
  • Google Bookmarks
  • DZone
  • MySpace
  • Reddit
  • StumbleUpon
  • Technorati
  • Yahoo! Bookmarks
  • RSS
Show Love to the Object Literal | Core JavaScript 1.5 Guide:Literals

1 Comment(s)

Comments RSS TrackBack Identifier URI

Leave a comment

  • Metadata
  • View Mohammed Arif's profile on LinkedIn
  • Follow arif_iq on Twitter
  • Technorati Profile
  • Add to Technorati Favorites
  • Calendar

    • September 2010
      M T W T F S S
      « Jun    
       12345
      6789101112
      13141516171819
      20212223242526
      27282930  
  • Search