[JS] Boolean 데이터 타입
개발노트/Javascript2019. 10. 15. 21:57[JS] Boolean 데이터 타입

개념 Boolean은 데이터 타입중에서 한 종류 이다. 데이터 타입에는 Number, String, Boolean, Function, Object, Null, undefined, Array가 있다. Boolean의 값으로는 true(참), false(거짓) 2개가 있다. 사용방법 비교 하기 console.log(1===1) // true 출력 console.log(1===2) // false 출력 👉 console.log(1==1) , console.log(1==2) 비교연산자를 써서 숫자 1 과 1이 맞으니깐 true를 출력하고 1 과 2가 다르니깐 false를 출력한다. 이렇게 데이터 타입을 비교하여 true 인지 false인지 알 수 있다. 조건문 사용하기 let booleanValue = true..

image