12. practice makes perfect


#1

https://www.codecademy.com/en/courses/javascript-beginner-en-9Sgpi/2/4?curriculum_id=506324b3a7dffd00020bf661#


My code is running, however, for my second object, object2, I would like the console to log just the integers that make up my age, 29. Right now it is logging the curly braces plus the word age. Is there a way to do this?

Thanks


var object2 = {
    age: 29
};
console.log(object2);


#2

You're logging the entire object array. Call the property age:

console.log(object2.age);
//or
console.log(object2['age']);

#3

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