+ 1
Strings Operator
In the course of Js on String Opeartor they said: Numbers in quotes are treated as strings: "42" is not the number 42, it is a string that includes two characters, 4 and 2. But if you write console.log("42") it outputs 42 ...Not a string Or What am i not Understand??
3 ответов
+ 12
The only problem here is that console.log function logs given parameter without " symbols surrounding. But if you log to console:
typeof "42"
you should get string.
+ 2
Okay , thks u guys ... I appreciate it
+ 1
Check this code for understand it...
var st = "43";
var n = 43
console.log(st)
console.log(typeof(st));
console.log(n)
console.log(typeof(n));