Defining new obejcts


#1



i have defined a new object. I have a small doubt.
24 is printed to console. whereas i havent written any console.log statement. Then why is the name karen is not printed to the console

var me=new Object();
 me["name"]="karen";
 me["age"]=24;


#2

Javascript always logs the last statement of your file, which in this case is me["age"]=24; (which returns 24). This is for debugging purposes.


#3

thank you @nicoekkart