Movatterモバイル変換


[0]ホーム

URL:


  1. 개발자를 위한 웹 기술
  2. JavaScript
  3. JavaScript 참고서
  4. 식 및 연산자
  5. 불일치 연산자 (!==)

This page was translated from English by the community.Learn more and join the MDN Web Docs community.

View in EnglishAlways switch to English

불일치 연산자 (!==)

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월⁩.

불일치 연산자 (!==) 는 두 피연산자가 같지 않은지 확인하고, 불리언 결과를 반환합니다.부등 연산자 와 다르게, 불일치 연산자는 두 피연산자의 타입이 다르다면 항상 다른 것이라고 여깁니다.

시도해 보기

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

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp