Reference Error, age is not Defined


#1

https://www.codecademy.com/courses/javascript-beginner-en-9Sgpi/2/4?curriculum_id=506324b3a7dffd00020bf661#
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();
object2.name = "Lily";
object2[age] = 29;

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


#2

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";


#3

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


#4

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