본문 바로가기

Programming/JavaScript

typeof

In JavaScript there are 5 different data types that can contain values:

  • string
  • number
  • boolean
  • object
  • function

There are 6 types of objects:

  • Object
  • Date
  • Array
  • String
  • Number
  • Boolean

And 2 data types that cannot contain values:

  • null
  • undefined

The typeof operator returns a string indicating the type of the unevaluated operand.

 

null은 -> object

 

Double Quotes vs. Single Quotes

쌍따옴표와 따옴표 차이 없음

둘다 string으로 인식됨

 

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof

 

typeof - JavaScript | MDN

The typeof operator returns a string indicating the type of the unevaluated operand.

developer.mozilla.org

 

https://www.w3schools.com/js/js_typeof.asp

 

JavaScript typeof

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com