This page was translated from English by the community.Learn more and join the MDN Web Docs community.
불일치 연산자 (!==)
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
불일치 연산자 (!==) 는 두 피연산자가 같지 않은지 확인하고, 불리언 결과를 반환합니다.부등 연산자 와 다르게, 불일치 연산자는 두 피연산자의 타입이 다르다면 항상 다른 것이라고 여깁니다.
In this article
시도해 보기
console.log(1 !== 1);// Expected output: falseconsole.log("hello" !== "hello");// Expected output: falseconsole.log("1" !== 1);// Expected output: trueconsole.log(0 !== false);// Expected output: true문법
js
x !== y설명
불일치 연산자는 두 피연산자의 같지 않음을 확인합니다. 이것은일치 연산자 의 반대 개념입니다. 따라서 다음 두 줄은 항상 같은 결과를 반환합니다.
js
x !== y;!(x === y);비교 방식에 대한 자세한 정보는일치 연산자 의 페이지에서 확인할 수 있습니다.
일치 연산자와 같이, 불일치 연산자는 두 피연산자의 타입이 다르면 항상 다른 것이라고 여깁니다.
js
3 !== "3"; // true예제
>같은 타입의 피연산자 비교
js
"hello" !== "hello"; // false"hello" !== "hola"; // true3 !== 3; // false3 !== 4; // truetrue !== true; // falsetrue !== false; // truenull !== null; // false다른 타입의 피연산자 비교
js
"3" !== 3; // truetrue !== 1; // truenull !== undefined; // true객체 간의 비교
js
const object1 = { key: "value",};const object2 = { key: "value",};console.log(object1 !== object2); // trueconsole.log(object1 !== object1); // false명세서
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-equality-operators> |