728x90
반응형
SMALL
Primitive Types
- string, number, bigint, boolean, undefined, symbol, null
- 기본타입은 객체가 아님
- 원시타입은 프로퍼티와 메소드를 정의할수 없다.
- new 키워드를 사용하여 원시 타입을 래퍼 객체로 생성할수 있지만, 주로 사용하는 방법은 아님
let a = 'apple'; => string -> 기본함수들은 사용가능하지만 String객체의 기능을 이용할수는없다.
그래서 String과는 다르다.
let a = new String('apple'); => String
string -> String()
number -> Number()
bigint -> BigInt()
boolean -> Boolean()
symbol -> Symbol()
URL(Uniform Resource Location), URI(Uniform Resource Identifier)
- 아스키 문자로만 구성되야 함
- 한글이나 특수문자는 이스케이프 처리
const URL = 'https://대한민국.com'
const encoded = encodeURI(URL) // 이스케이프 처리
const decoded = decodeURI(encoded) // 돌려놓기
728x90
반응형
LIST
'JavaScript' 카테고리의 다른 글
JavaScript - iterable( 이터러블 ) (0) | 2023.04.11 |
---|---|
JavaScript - 이벤트(Event) (0) | 2023.04.11 |
JavaScript - Wrapper (0) | 2023.04.11 |
JavaScript - 클래스 상속 예시 (0) | 2023.04.11 |
JavaScript - 클래스 활용예시 (0) | 2023.04.11 |