Practice makes perfect


#1


Practice makes perfect


no error messages but it is printing only one thing to console,why?


var object1 = new Object();
object1.howRu = "fine";
var object2 = new Object();
object2.whYoNa ="Prashant";
var object3 = new Object();
object3.good = "good";


output is : "good"
the last object why it didn't printed other things to console


#2

The output you are seeing is a built in behavior of the console... To empty the buffer, which contains the last assignment written in the code. 'good'. To get full output you need to include your own console.log() statements.

console.log(object1.howRu)

and so on with the other two.


#3

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