#Simple question I assume, Why are these statements true/false

13 messages · Page 1 of 1 (latest)

solemn oracle
#

I honestly have no clue probably some weird node/js thing?

vital barn
#

most languages have this. this is comparing by reference

south isle
#

Yeahh if you were comparing two primitives (string, number, bool .etc) you'd get the opposite. But an array is an object.

vital barn
#

the variables are referring to different arrays, that's what the equality check does

solemn oracle
#

Ah gotcha

#

It checks if its referencing the same array not if the arrays are the same?

vital barn
#

if you had const arr2 = arr1; though, you would have them both pointing to the same array, so you'd get them to be equal

solemn oracle
#

Its weird how ive never ran into this before

#

Well thanks for letting me know

true cedar
#

!close