JavaScript
자바스크립트 : JS 변수
lily_y
2023. 10. 6. 14:39
var
중복 선언 가능
let
- const
- Boolean( ) 은 문자형은 한자리라도 나오면 true
숫자형은 0이 아닌 값은 true - undefined : 변수를 선언했을때 값이 등록되기 전의 기본값
- null : 변수에 null을 저장했을 때
- typeof : 지정한 데이터 또는 변수에 저장된 자료형을 알고 싶을 때 사용
- document.write(typeof num); //결과값 : number document.write(typeof str); // 결과값 : string