코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript Predefined Function</title> </head> <body> <h1>Number() 함수</h1> <script> document.write(Number("123") + "<br>"); document.write(Number("123.000") + "<br>"); document.write(Number("123.456") + "<br>"); document.write(Number("12 34 56") + "<br>"); document.write(Number("123 초콜릿") + "<br><br>"); document.write(Number(true) + "<br>"); document.write(Number(false) + "<br>"); document.write(Number(new Date()) + "<br>"); document.write(Number(null)); </script> </body> </html>