Reference Error, age is not Defined

Reference Error, age is not Defined. // Oops, try again. Did you make object3 an object?

var object1 = {
name: "Dreg Master",
age: 35

var object2 = new Object(); = "Lily";
object2[age] = 29;

var object3 = new Object(); = "01100110110";
object3[font] = "arial";


object2[age] = 29;

As you're using string as key ( age )and using bracket method to create key,value pair, You need to surround them inside quotes ( "age")

also introduce same modification in this line of code..
object3[font] = "arial";


Thank you. That's it :slight_smile:
Many ways to do same thing, sometimes confusing.


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