页次: 1
js 中的数据类型, 函数也是一种数据类型
<script> w = function(type) { document.writeln("<pre> typeof(" + type + ") :" + typeof (type) + " </pre>"); }; w('1'); w(1); w(w); w(false); w(undefined); w(window); </script>
打印的结果
<pre> typeof(1) :string </pre> <pre> typeof(1) :number </pre> <pre> typeof(function (type) { document.writeln("<pre> typeof(" + type + ") :" + typeof (type) + " </pre>"); }) :function </pre> <pre> typeof(false) :boolean </pre> <pre> typeof(undefined) :undefined </pre> <pre> typeof([object Window]) :object </pre>
<a href="http://www.ipbbs.net/viewforum.php?id=4"> jquery教程</a>
离线
页次: 1