标签:type blog href log xmlns head tag body asc
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>javascript数据类型</title><script type="text/javascript">/*javascript的数据类型:number string boolean undefined 共4种。类型的总结:所有的数值都是number类型字符和字符串都是string类型布尔是boolean类型如果一个变量没有初始化值的时候,其类型为undefined类型。表示没有定义。typeof 可以查看变量的数据类型。使用格式:typeof 变量名*/document.write("10数据类型是:" + (typeof 10) + "<br/>");document.write("9.99数据类型是:" + (typeof 9.99) + "<br/>");document.write("‘a‘数据类型是:" + (typeof ‘a‘) + "<br/>");document.write("‘abc‘数据类型是:" + (typeof ‘abc‘) + "<br/>");document.write("\"abcdef\"数据类型是:" + (typeof "abcdef") + "<br/>");document.write("true数据类型是:" + (typeof true) + "<br/>");document.write("a数据类型是:" + (typeof a) + "<br/>");</script></head><body></body></html>

标签:type blog href log xmlns head tag body asc
原文地址:http://www.cnblogs.com/itMiracle/p/5990752.html