JavaScript 13
1317 ワード
<!DOCTYPE html>
<html>
<head>
<title>Javascript 13</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<script type="text/javascript">
/*
* global 。
*/
document.write(parseInt("123") + 1 + "<br>");
var val = parseInt("abc"); //val = NaN;
document.write("value=" + isNaN(val) + "<br>");// isNaN 。
var val = parseInt("12abc");
document.write("value=" + val + "<br>");
// 。
var num = parseInt("110", 2);
document.write("num=" + num + "<br>");
var num1 = parseInt('0x3c', 16);
document.write("num1=" + num1 + "<br>");
// 。 。
var num3 = new Number(6);
document.write("num3=" + num3.toString(2) + "<br>");
var num4 = 60;
document.write("num4=" + num4.toString(16) + "<br>");
</script>
</body>
</html>