+ 1
Why is the output b? JS challenge
3 Respuestas
+ 6
When you use new, you explicitly express your desire to work with object.
It's simple: compared are not the objects' insides, but the objects' references. And they, of course, are not equal, as two different objects were created.
Thanks and happy coding
+ 2
Because a and b are 2 different string object.
0
let a = "hello"
let b = "hello"