느낌표 두개(!!) 는 undefined, "", 0 값은 false. 그외에는 true 값을 리턴합니다.
느낌표 세개(!!!) 는 두개(!!) 의 부정으로 사용합니다.
예) var testVal = null;
alert(!!testVal);
알림창 : false
alert(!!!testVal);
알림창 : true
출처: https://ookai.tistory.com/10 [어제보다 한걸음더]
느낌표 두개(!!) 는 undefined, "", 0 값은 false. 그외에는 true 값을 리턴합니다.
느낌표 세개(!!!) 는 두개(!!) 의 부정으로 사용합니다.
예) var testVal = null;
alert(!!testVal);
알림창 : false
alert(!!!testVal);
알림창 : true
출처: https://ookai.tistory.com/10 [어제보다 한걸음더]
댓글