Create Objects error


#1

Hello,

I keep getting errors for my code below.. I will appreciate some help.

var object1 = new Object();
object1.name = "Max";
object1.age = 25;

var object2 = new Object();
object2['email'] = "Max@hotmail.com";
object2.phone = 55555555;

var object3 = new Object{};
object3.id = 03556565;
object3.mob = 54545454;

`


#2

this line:

var object3 = new Object{};

why did you decide to use curly brackets {} instead of parentheses ()?


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.