i m just learning es 6 and i just socked when... i run this code..
var name = ["Rahul","Ritika","Amit","Radhika"]; console.log(name.length);
the answer is 25.. 25 why? it must have the answer 4 but gives 25 i don't know why?
i just run the code in browser console the answer is same... 25
but when i change the name of the variable name to something else like "c_name" it works fine...
let c_name = ["Rahul","Ritika","Amit","Radhika"]; console.log(c_name.length);
when i m trying to execute this code the out is again miss behaving...
// with name varible let name = ["Rahul","Ritika","Amit","Radhika"]; for(let i = 0 ; i < name.length; i++) console.log(name[i]);
****output****
"Rahul"
"Ritika"
"Amit"
"Radhika"
// other variable let c_name = ["Rahul","Ritika","Amit","Radhika"]; for(let i = 0 ; i < c_name.length; i++) console.log(c_name[i]);
output
"R"
"a"
"h"
"u"
"l"
","
"R"
"i"
"t"
"i"
"k"
"a"
","
"A"
"m"
"i"
"t"
","
"R"
"a"
"d"
"h"
"i"
"k"
"a"