7.typeof的用法
Posted 许先
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了7.typeof的用法相关的知识,希望对你有一定的参考价值。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>typeof的功能和用法演示</title> <script type="text/javascript"> document.write("<h2>对变量或值调用typeof运算符返回值:</h2>"); var width,height=10,name="rose"; var date=new Date(); //获得时间日期对象 var arr=new Array(); //定义数组 document.write("width: "+typeof(width)+"<br>"); document.write("height: "+typeof(height)+"<br>"); document.write("name: "+typeof(name)+"<br>"); document.write("date: "+typeof(date)+"<br>"); document.write("arr: "+typeof(arr)+"<br>"); document.write("true: "+typeof(true)+"<br>"); document.write("null: "+typeof(null)); </script> </head> <body> </body> </html>
以上是关于7.typeof的用法的主要内容,如果未能解决你的问题,请参考以下文章