[JS] typeof null, null instanceof Object

2021. 7. 13. 01:53·과거
반응형
typeof null; // object

null instanceof Object; // false

null은 어떤 값이 '비어있음(absense)'을 나타낸다.
primitive value 이며 falsy 한 값으로 취급된다.

https://262.ecma-international.org/5.1/#sec-11.4.3

 

ECMAScript Language Specification - ECMA-262 Edition 5.1

This section contains a non-normative overview of the ECMAScript language. ECMAScript is an object-oriented programming language for performing computations and manipulating computational objects within a host environment. ECMAScript as defined here is not

262.ecma-international.org

https://stackoverflow.com/questions/28956060/javascript-confusing-syntax-inconsistence-for-null-instanceof-and-typeof

 

Javascript confusing syntax inconsistence for null, instanceof and typeof?

var obj = {}; typeof obj; // returns "object" obj instanceof Object // return true typeof null // returns "object" null instanceof Object // returns false And how about typeof undefined // retu...

stackoverflow.com

 

반응형

'과거' 카테고리의 다른 글

성능 최적화  (0) 2021.09.06
[JS] Object property order  (0) 2021.07.13
details marker 제거  (0) 2021.07.13
이벤트 리스너, 이벤트 위임  (0) 2021.07.13
[JS] Lexical Grammar, Language Element  (0) 2021.07.05
'과거' 카테고리의 다른 글
  • 성능 최적화
  • [JS] Object property order
  • details marker 제거
  • 이벤트 리스너, 이벤트 위임
optimy
optimy
See one, do one, teach one
  • optimy
    공자천주
    optimy
  • 전체
    오늘
    어제
    • All posts (27)
      • Note (4)
      • Book (0)
      • Do one (0)
      • Teach one (0)
      • 과거 (23)
  • 블로그 메뉴

    • 링크

      • github
    • 공지사항

    • 인기 글

    • 태그

      details marker 제거
      Runtime Execution
      이미지파일저장
      개발자 도구 활용
      능동적 태도
      창 그룹화
      캡처후저장
      복사한것저장
      콜맥
      탭 관리 프로그램
      version specifications
      JavaScript
      프론트엔드 개발환경
      쿼티
      구현 패턴
      State Control
      브라우저 렌더링
      날개셋 한글 입력기
      이벤트 위임
      Sync & Async
    • 최근 댓글

    • 최근 글

    • hELLO· Designed By정상우.v4.10.0
    optimy
    [JS] typeof null, null instanceof Object
    상단으로

    티스토리툴바