How do i create a new object in JavaScript?

Discussion in 'JavaScript' started by raspms, Mar 8, 2012.

  1. #1
    i want to create object in javascript..but i dont know how it will be created..?
     
    raspms, Mar 8, 2012 IP
  2. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #2
    var newObject= new Object();
    Code (markup):
    the shorthand version of it:

    var newObject= {};
    Code (markup):
     
    JohnnySchultz, Mar 9, 2012 IP