JavaScript10 javascript 기초부시기 - 데이터 타입이란 1.데이터 타입이란 - 프로그래밍 언어에서 사용할 수 있는 데이터의 종류. 2. 데이터 타입의 종류 2.1 원시타입 - boolean - null - undefined - number - string - symbol 2.2 객체 타입 - object 3. 원시 타입 원시타입은 변경 불가능한 값이며, pass-by-value(값에 의한 전달)이다 라고 정의되어있다. let str = 'hello'; str = 'world' 3.1 변경 불가능값? 위의 코드를 실행하면 메모리에 문자열 hello가 생성되고, 식별자 str은 메모리에 생선된 문자열 'hello'의 메모리 주소를 가르킨다고 한다. 두번째 구문이 실행되면 'hello'를 수정하는것이 아니라, 새로운 문자열인 'world'를 메모리에 생성하고, 식.. 2022. 5. 11. [Javascript] Type 체크 1. Type of Type of의 경우 피연산자의 데이터 타입을 문자열로 반환한다. typeof ''; // string typeof 1; // number typeof NaN; // number typeof true; // boolean typeof []; // object typeof {}; // object typeof new String(); // object typeof new Date(); // object typeof /test/gi; // object typeof function () {}; // function typeof undefined; // undefined typeof null; // object typeof undeclared; // undefined 배열과 객체도 objec.. 2021. 6. 2. 이전 1 2 3 다음