js数据类型
2021-04-25 20:29
标签:abc har bool char oct doc body 没有 head js数据类型 标签:abc har bool char oct doc body 没有 head 原文地址:https://www.cnblogs.com/987m/p/12227887.htmlDOCTYPE html>
html lang="en">
head>
meta charset="UTF-8">
title>Documenttitle>
script>
//定义number类型
var num = 1;
var num2 = 1.2;
var num3 = NaN;
//输出到页面上
document.write(num+"
");
document.write(num2+"
");
document.write(num3+"
");
//定义string类型
var str = "abc";
var str2 = ‘adf‘;
document.write(str+"
");
document.write(str2+"
");
//定义bollean
var flag = true;
document.write(flag+"
");
//定义null,undefined
var obj = null;
var obj2 = undefined;
var obj3 ;
document.write(obj+"
");
document.write(obj2+"
");
document.write(obj3+"
");
script>
head>
body>
body>
html>