상세 컨텐츠

본문 제목

원시 값

JavaScript

by 마라랑랑 2022. 5. 23. 02:03

본문

typeof undefined;   		undefined
typeof true;   			boolean
typeof 'string';    		string
typeof 123;     		number
typeof 9007199254740992n;   	bigint
typeof Symbol();    		symbol 
typeof null;    		object

typeof 를 통하여 원시값 확인가능

biginit 은 숫자의 최댓 값을 초과한 값

null 은 원시 값이지만 object로 표기되는 오류가 있다.

 

let test = 'string';

test.toUpperCase();
console.log('string'.toUpperCase());    STRING

console.log(test);   string
const bool = false;
!bool;

console.log(bool);  false

원시 값은 불변한다.

'JavaScript' 카테고리의 다른 글

undefined & null  (0) 2022.05.23
참조 타입  (0) 2022.05.23
use strict  (0) 2022.05.22
리터럴  (0) 2022.05.22
식별자  (0) 2022.05.22

관련글 더보기

댓글 영역