Object.is() determines whether two values are the same
scalar values
1 is the same as 1
int 1 is different to string "1"
strings just have to match
+0 is not the same as -0
NaN is the same as NaN
coercion (as in ==) and strict compare (as in ===) do NOT apply
+0 and -0 are not the same for Object.is()
empty string and false are not the same
NaN
NaN and 0/0
complex values
{} is just not the same as {}
for the same object is() reports true
two Maps with the same content are not the same thing
Required Knowledge
- `let` declaration (Block scope)
- `const` declaration (Block scope)
- basics (Map)
Related Katas
Global Object API
Object API
Object()(as introduced in ES1)Object.is()Object.fromEntries()Object.fromEntries()in depthObject.groupBy()
Object literal
Difficulty Level
BEGINNER
First Published
24 June 2015
Stats
12 tests to solve