codeSTACKr

In JavaScript, what does the following expression evaluate to?

[ ] == [ ]

For more JavaScript tips & tricks 👉 https://youtu.be/ZI3q-_vjSZE

4 years ago | [YT] | 117



@codeSTACKr 

The correct answer is false. This is because array references are unique. These are two separate arrays that may contain unique data. For more JavaScript tips & tricks 👉 https://youtu.be/ZI3q-_vjSZE

4 years ago | 32

@oxyaego4594

To everone who voted true: crtl + shift + j

4 years ago (edited) | 10  

@amitmondal7427

The correct answer is false Because two array are always has different location address. And also has different references.

4 years ago | 10  

@gsmsalihou4505

I forgot about the heap 😞

4 years ago | 1  

@paulholsters7932

I reasoned it was false not because of unique references. I reasoned arrays are considered objects in javascript not normal datatypes like string or number. And 2 objects never are the same, not even when they are instances of the same class. I doubt whether being unique references even is a solid argument for the expression to evaluate to false. The following expression, given first = 1 and second = '1' evaluates to true although both reference different things: first == second. Or is this false also?

4 years ago | 1

@Gnsdtc

False because if the answer would have been true, this wouldn't have been a question.

4 years ago | 2  

@niksperience

Damn, out of head in mid of night i thought double equals will go true... cuz JavaScript, you never know

4 years ago | 1

@soumadip_banerjee

got it..❤️

4 years ago | 1  

@ianpogi5

The correct answer is not to use double equals.

4 years ago | 0  

@muxsinbashir10

Pls sire why you stoped stacker news pls lets back the program

4 years ago | 0  

@bullettime2808

Why is everyone voting true ?

4 years ago | 0

@chrisryu2179

Why is it false?

4 years ago | 0