| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Object/is | [Back] [Original] |
Get to know MDN better
console.log(Object.is("1", 1));
// : false
console.log(Object.is(NaN, NaN));
// : true
console.log(Object.is(-0, 0));
// : false
const obj = {};
console.log(Object.is(obj, {}));
// : false
Object.is(value1, value2)
2
Object.is() == == "" == false true Object.is()
Object.is() === Object.is() === NaN === == -0 +0 NaN
// 1: ===
Object.is(25, 25); // true
Object.is("foo", "foo"); // true
Object.is("foo", "bar"); // false
Object.is(null, null); // true
Object.is(undefined, undefined); // true
Object.is(window, window); // true
Object.is([], []); // false
const foo = { a: 1 };
const bar = { a: 1 };
const sameFoo = foo;
Object.is(foo, foo); // true
Object.is(foo, bar); // false
Object.is(foo, sameFoo); // true
// 2:
Object.is(0, -0); // false
Object.is(+0, -0); // false
Object.is(-0, -0); // true
// 3: NaN
Object.is(NaN, 0 / 0); // true
Object.is(NaN, Number.NaN); // true
| ECMAScript 2027 LanguageSpecification # sec-object.is |
Objectassign()create()defineProperties()defineProperty()entries()freeze()fromEntries()getOwnPropertyDescriptor()getOwnPropertyDescriptors()getOwnPropertyNames()getOwnPropertySymbols()getPrototypeOf()groupBy()hasOwn()is()isExtensible()isFrozen()isSealed()keys()preventExtensions()seal()setPrototypeOf()values()Object/Function| Web Proxy Viewer | New URL | Original Page |