A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Strict_inequality below:

불일치 연산자 (!==) - JavaScript

불일치 연산자 (!==)

Baseline Widely available

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

시도해 보기
console.log(1 !== 1);
// Expected output: false

console.log("hello" !== "hello");
// Expected output: false

console.log("1" !== 1);
// Expected output: true

console.log(0 !== false);
// Expected output: true
문법 설명

불일치 연산자는 두 피연산자의 같지 않음을 확인합니다. 이것은 일치 연산자 의 반대 개념입니다. 따라서 다음 두 줄은 항상 같은 결과를 반환합니다.

비교 방식에 대한 자세한 정보는 일치 연산자 의 페이지에서 확인할 수 있습니다.

일치 연산자와 같이, 불일치 연산자는 두 피연산자의 타입이 다르면 항상 다른 것이라고 여깁니다.

예제 같은 타입의 피연산자 비교
"hello" !== "hello"; // false
"hello" !== "hola"; // true

3 !== 3; // false
3 !== 4; // true

true !== true; // false
true !== false; // true

null !== null; // false
다른 타입의 피연산자 비교
"3" !== 3; // true
true !== 1; // true
null !== undefined; // true
객체 간의 비교
const object1 = {
  key: "value",
};

const object2 = {
  key: "value",
};

console.log(object1 !== object2); // true
console.log(object1 !== object1); // false
명세서 브라우저 호환성 같이 보기

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4