0

Question from code challenges

Hello, can someone please explain this solution? var x = { age: 24 } var y = x; var z = { age: 24 } alert(y !== (x !== z)) Why is the end result in the end true? Thanks

18th Aug 2021, 9:29 PM
David
David - avatar
3 odpowiedzi
+ 3
x !== z -> True (object can't be equal with the another object even they have same property with the value!) so it is true y is an object, x !== z is a boolean. These two are not strictly equal. So the result is true!
19th Aug 2021, 12:34 AM
Matias
Matias - avatar
+ 1
Thanks Matiyas!
19th Aug 2021, 4:45 AM
David
David - avatar
+ 1
You welcome David
19th Aug 2021, 3:20 PM
Matias
Matias - avatar