IT/JavaScript

==, === 연산자 비교

최고영회 2013. 12. 23. 08:31
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