본문 바로가기
IT/JavaScript

==, === 연산자 비교

by 최고영회 2013. 12. 23.
728x90
반응형
SMALL

javascript 에서 == 연산자는 데이터 타입(String, Int, Long)과 상관없이 값만 같으면 true를 리턴한다. 

=== 연산자는 데이터 타입과 값이 같은 경우에만 true를 리턴한다.


=== This is the strict equal operator and only returns a Boolean true if both the operands are equal and of the same type. These next examples return true: 
a === 2 
b === 4 


!== This is the strict not equal operator and only returns a value of true if both the operands are not equal and/or not of the same type. The following examples return a Boolean true: 
a !== b 
a !== "2" 
4 !== '4' 

728x90
반응형
LIST

'IT > JavaScript' 카테고리의 다른 글

자바스크립트 핵심 가이드 - (문법)  (0) 2013.12.23
자바스크립트 기초 (JavaScript Garden)  (0) 2013.12.23
JavaScript 공부 방법  (0) 2013.12.23
javascript 날짜 계산  (0) 2013.12.23
replaceAll 속도 비교  (0) 2013.12.22