data type
primitive data type in js
1. Number: Floating point numbers → Used for decimals and integers
-
소수, 정수 모두 사용된다. 즉 소수, 정수 모두 number 데이터 타입이다.
2. String: Sequence of characters → Used for text
3. Boolean: Logical type that can only be true or false → Used for taking decisions
4. Undefined: Value taken by a variable that is not yet defined (‘empty value’)
-
선언했지만 밸류 할당하지 않은 데이터 타입
-
ex) let children;
5. Null: Also means ‘empty value’
6. Symbol (ES2015): Value that is unique and cannot be changed
7. BigInt (ES2020): Larger integers than the Number type can hold
자바스크립트는 dynamic typing 방식으로 작동한다. 즉 변수 선언할 때 데이터 타입을 지정할 필요가 없다. 다시말해,
자바스크립트에선 변수가 아닌, value가 데이터 타입을 갖는다.
"JavaScript has dynamic typing : We do not have to manually define the data type of the value stored in a variable. Instead, data types are determined automatically"
** 이 포스트는 Udemy의 "The Complete JavaScript Course 2021: From Zero to Expert!" 강좌를 토대로 작성한 글입니다.
'TIL > JAVASCRTIPT' 카테고리의 다른 글
Section2-33~37 Function (0) | 2021.01.02 |
---|---|
Section2-20 Type Conversion and Coercion (0) | 2021.01.02 |
Section2-13 let, const, var (0) | 2021.01.02 |