Section2-12 Data Type
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!" 강좌를 토대로 작성한 글입니다.