반응형 null undefined undeclared 차이1 Null, Undefined, Undeclared 차이 null 의도적으로 빈 값을 할당한 경우 let a = null; console.log(a); // null console.log(typeof a); // object null 이 객체였다! 그러고보니 프로젝트에서도 null 이 객체로 찍혀서 당황스러웠던 기억이 있다. undefined 선언되었지만 아무 값도 할당되지 않은 상태 let b; console.log(b);// undefined console.log(typeof b);// undefined undeclared 선언조차 되지 않은 변수, 레퍼런스 에러 console.log(류준열짱) // VM1693:1 Uncaught ReferenceError: 류준열짱 is not defined // at :1:13 2021. 12. 30. 이전 1 다음 반응형