DEV Community

Cover image for The most repeated questions I met with on job interviews (part 1)

The most repeated questions I met with on job interviews (part 1)

Jakub Smetanka on September 19, 2021

A wiseman once said : "If you can not explain it, you do not understand it". A few years ago, when I had searched for a job as a student I went thr...
Collapse
 
sfiquet profile image
Sylvie Fiquet

I was surprised by your assertion that you can use Object.is to compare two objects instead of === so I looked it up on MDN. Like ===, Object.is compares references. It will return false for two distinct objects with the same properties.

The only difference between Object.is() and === is in their treatment of signed zeroes and NaNs.

Collapse
 
smetankajakub profile image
Jakub Smetanka

You are right, thanks, I have edited text

Collapse
 
ranemihir profile image
Mihir Rane

Short and to the point. Really helpful article, thanks!

Collapse
 
captainyossarian profile image
yossarian

Bte, sometimes I use === to compare obj ref

Collapse
 
timbrown profile image
Timothy Brown

Short and useful! Great article!

Collapse
 
arohi profile image
Arohi7892

Very Insightful Blog!

Collapse
 
the_one profile image
Roland Doda

I don't think that Object.is returns true if objects are equal:

var foo = { a: 1 };
var bar = { a: 1 };
Object.is(foo, bar); // false

Even empty arrays are not equal:
Object.is([], []); // false

Collapse
 
smetankajakub profile image
Jakub Smetanka

Thanks, my bad. I have edited it.

Collapse
 
piyushmbm45 profile image
Piyush Jain

Nice Article Jakub...

Collapse
 
sousacaio profile image
Caio frias

Nice iniciative bro, most of my interviews i encounter with these questions.

Collapse
 
smetankajakub profile image
Jakub Smetanka

Glad to hear that