Hi,
Consider the below simple code :
'k' instanceof String; // false
new String('k') instanceof String; // true
Now, When I am inspecting them as below why in both cases the output comes as
[object String] ?
The below is understood as per the result of the `instanceof` operator.
Object.prototype.toString.call( new String('k') ); // "[object String]”
My confusion comes when I see the below code output :
Object.prototype.toString.call( 'k' ); // "[object String]”
Can anyone please explain it ?
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss