107
rated 0 times
[
108]
[
1]
/ answers: 1 / hits: 55217
/ 11 Years ago, tue, may 28, 2013, 12:00:00
In JavaScript, I can declare a string in the following ways;
var a = Hello World;
var b = new String(Hello World);
but a is not an instance of String...
console.log(a instanceof String); //false;
console.log(b instanceof String); //true;
So how do you find the type or instanceof
a string literal?
Can JavaScript be forced to create a new String()
for every string literal?
More From » string