Why does the screen only log the last value?


#1


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

My code behaves correctly I'm just curious as to why it only logs my name: "Matthew" and not my age: 32? Just a curiosity question. Thanks

var me = new Object();

me["age"] = 32;
me["name"] = "Matthew"


#2

the codecademy console just logs the last value. If you want to log more, use console.log()


#3

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