<html> <head> <base href="<%=basePath%>"> <title>JS typeof测试</title> </head> <body> <script>document.write ("typeof(1): "+typeof(1)+"<br>");document.write ("typeof(NaN): "+typeof(NaN)+"<br>");document.write ("typeof(Number.MIN_VALUE): "+typeof(Number.MIN_VALUE)+"<br>")document.write ("typeof(Infinity): "+typeof(Infinity)+"<br>")document.write ("typeof(/"123/"): "+typeof("123")+"<br>")document.write ("typeof(true): "+typeof(true)+"<br>")document.write ("typeof(window): "+typeof(window)+"<br>")document.write ("typeof(document): "+typeof(document)+"<br>")document.write ("typeof(null): "+typeof(null)+"<br>")document.write ("typeof(eval): "+typeof(eval)+"<br>")document.write ("typeof(Date): "+typeof(Date)+"<br>")document.write ("typeof(sss): "+typeof(sss)+"<br>")document.write ("typeof(undefined): "+typeof(undefined)+"<br>")document.write ("typeof(1,2,3): "+typeof(1,2,3)+"<br>")</script><br> </body></html>结果:
typeof(NaN): numbertypeof(Number.MIN_VALUE): numbertypeof(Infinity): numbertypeof("123"): stringtypeof(true): booleantypeof(window): objecttypeof(document): objecttypeof(null): objecttypeof(eval): functiontypeof(Date): functiontypeof(sss): undefinedtypeof(undefined): undefinedtypeof(1,2,3): number
新闻热点
疑难解答