종우의 컴퓨터 공간
데이터 타입(data types) 본문
Primitive Data Type
- stroed directly in the location the variable accesses
- stored on the stack
- String, Number, Boolean, Null, Undefined, Symbols(ES6)
Reference Data Type
- accessed by reference
- objects that are stored on the heap
- a pointer to a location in memory
- Arrays, Object Literals, Functions, Dates, Anything Else...
Dynamically Typed Language
- Types are associated with values not variables
- The same variable can hold multiple types
- We do not need to specify types
- Most other languages are statically typed (Java, C#, C++)
- There are supersets of JS and addons to allow static typing(TypeScript, Flow)
'typeof' 연산자
- typeof 연산자는 피연산자의 평가 전 자료형을 나타내는 문자열을 반환한다.
- primitive data type 중에 Null은 자료형이 Object로 나오는데, 일종의 버그라고 생각하면 된다.
'자바 스크립트 (JavaScript) > JavaScript Language Fundamentals' 카테고리의 다른 글
템플릿 문자열(Template Literals) (0) | 2021.07.24 |
---|---|
String Methods (0) | 2021.07.24 |
The Math Object (0) | 2021.07.24 |
형 변환(Type Conversion) (0) | 2021.07.24 |
변수 선언 방식(var, let, const) & 스코프 (0) | 2021.07.23 |