[JS]null vs undefined

김호중·2023년 7월 25일
0

javascript

목록 보기
1/9
post-thumbnail

들어가기 전

  • "==" vs "==="
    간단히 비교하자면
    == : value만 비교
    === : value와 type 둘 다 비교
    참고자료

null

Null is an assignment value. It can be assigned to a variable as a representation of no value.

value을 선언함. 해당 value가 비었음을 직접 나타냄. 즉, 빈 값을 할당함.

undefined

Undefined means a variable has been declared but has yet not been assigned a value.

즉, value를 선언함. 하지만 값을 할당하지 않음. 즉, 비어있음(null)조차 할당해주지 않은 것
참고자료 1
참교자료 2

profile
개발의 흔적을 남기고 쌓아가기 위한 일기장

0개의 댓글