When i delete just x from typeof x and runit gives numberobject as a output with no spaces when i just delete y from type y and run it gives nothing
When you create a variable like this;
var a = "hello world", you’re using a string literal to create the string. But when you create a variable like this;
new String("hello world"), you’re actually instantiating the "String" object.
When replacing a string object, a new object is created each time, but with a string literal, it is only replaced.
The problem that you’re mentioning is happening because you are using the
typeof() function without any paranthesis, which means your code is trying to use
+ "<br>" as the arguments. The type of
+ "<br>" is a number, that’s why it’s telling you it’s a
number in the same line as
<br> isn’t being rendered because you used it in the function). Instead, use ‘typeof’ like
typeof(VAR) instead of
Answered By – squidee_
Answer Checked By – Clifford M. (BugsFixing Volunteer)