LiJell's 성장기

Booleans 본문

Front-End/JavaScript

Booleans

All_is_LiJell 2022. 5. 13. 18:11
반응형

true

  • 1

false

  • 0

null

  • null은 자연스럽게 생기지 않음
  • variable 안에 어떤것도 없다는 것을 확실히 알려주기 위해 씀
const amIFat= null;
// amIFat에 아무것도 채워지지 않은 null 채우는것을 의미
let something;
console.log(amIFat);

null


Undefined

  • something이라는 var을 만들었지만, 값을 주지 않은 상태
  • 메모리 안에 공간은 있지만, 값은 없는 상태
const amIFat= null;
let something;
// something이라는 var을 만들었지만, 값을 주지 않은 상태
// 메모리 안에 공간은 있지만, 값은 없는 상태
console.log(something);

undefined

 

반응형

'Front-End > JavaScript' 카테고리의 다른 글

Conditional  (0) 2022.05.18
Events  (0) 2022.05.17
Function  (0) 2022.05.17
Data Type  (0) 2022.05.17
const 와 let의 차이점  (0) 2022.05.13
Comments