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
'Programming > JavaScript' 카테고리의 다른 글
Difference Between == and === in JavaScript (0) | 2022.03.08 |
---|---|
JavaScript treats variables that are undefined as false. (0) | 2022.03.08 |
Arrays (0) | 2022.03.08 |
What is loosely typed in JavaScript? (0) | 2022.03.07 |
The plus sign (+) does double duty (0) | 2022.03.07 |