Long story short. Why is
console.log(obj.hello[0].w == ['hi','hi']); // false
in the following:
var obj = {
'hello':[
{'w':['hi','hi']}
]
}
console.log(obj.hello[0].w); // ['hi','hi']
console.log(obj.hello[0].w == ['hi','hi']); // false ??? Why is it false?
console.log(obj.hello[0].w[0] == 'hi'); // true
console.log(obj.hello[0].w[0] == ['hi']); // true
console.log(obj.hello[0].w[0] === ['hi']); // false
console.log(obj.hello[0].w[0] === 'hi'); // true
If obj.hello[0].w != ['hi','hi']
, then what is the 'real' value of obj.hello[0].w
?
EDIT: I first thought the problem was about JSON but it turned out it's about comparing objects. Sorry, for duplicate.