개념
<script>
/*
[typeof 숫자]
- 자바스크립트에서 숫자는 정수와 소수를 구분하지 않고
- 모두 number 자료형으로 처리됩니다.
- 따라서 10과 3.14는 모두 같은 자료형인 number로 취급됩니다.
[자료형 확인]
- 자바스크립트에서 typeof 연산자를 사용하여
- 데이터의 자료형을 확인할 수 있습니다.
*/
document.write(10, "<br>");
document.write(typeof 10, "<br>");
document.write(3.14, "<br>")
document.write(typeof 3.14, "<br>")
console.log(10);
console.log(typeof 10);
console.log(3.14);
console.log(typeof 3.14);
</script>
HTML
복사