When I try to assign number value to JavaScript keyword name as like below
var a="12345";
var b=a.substring(1,3)
console.log(b);
var name=12345;
var y=name.substring(1,3)
console.log(y);
I excepted it to throw the type error, but it produces the same output for variable b and name.
I'm aware that keywords should not be used as variable, still curious to know how it works.