코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Number Object</title> </head> <body> <h1>Number 객체</h1> <script> var x = 100; // 숫자 리터럴 var y = new Number(100); // Number 객체 document.write(x + "<br>"); // 100 document.write(y + "<br>"); // 100 document.write(typeof x + "<br>"); // number 타입 document.write(typeof y + "<br>"); // object 타입 </script> </body> </html>