What does Object('abc')
do?
In the Chrome console:
-> var test = Object('123')
<- undefined
-> test
<- String {"123"}
0: "1"
1: "2"
2: "3"
length: 3
__proto__: String
[[PrimitiveValue]]: "123"
-> var test2 = '123'
<- undefined
-> test2
<- "123"
I saw this in a presentation, though it was not explained. I would look it up myself, but I do not know what words to use. I've tried searching on the MDN Object Reference but haven't found anything yet.