<script language=javascript>
var a=new Array(1,2,3)
alert(a.constructor);
</script>
var a=new Array(1,2,3)
alert(a.constructor);
</script>
解决方案 »
- JavaScript 的replace正则问题 在线等
- 求谷歌地图API KEY 加密函数如下面的getApiKey(),但有错
- IE工具栏增加按钮功能后,如何实现点击IE工具栏新增的按钮点击后出现像IE工具栏历史按钮的效果
- 请大家来帮忙看一段代码,关于html:select的,onchange方法没法激活
- 是否可以实现直接调用客户端声音文件来播放呢???
- 能不能判断出一个页面是加载的历史记录?也就是使用history.go(-1)回来的
- 有没有办法获取style的内容?在线等
- 运行期错误
- 如有多组以,号分开的且,号的个数固定的数字组合并怎么写?
- 请教一个checkbox连续选择的问题
- 我想用js在某一个父层输出子层,有什么办法?
- 如何打开文件选择对话框,将文件保存至用户指定的位置??谢谢
typeof 返回六种可能的值:“数字类型”、“字符串类型”、“布尔型”、“对象类型”、“函数类型”和“未定义类型”。
数组为认为一种object类型<script language=javascript>
var a=new Array(1,2,3);
var b=2;
var c="2eee";document.write(" The type of is " + typeof(a) );
document.write(" The type of is " + typeof(b) );
document.write(" The type of is " + typeof(c) );
alert(a.length);</script>
function func1(a){
if(a!=null){
if(a.length){
alert("array";
}else{
alert("is not array")
}
}
}
function func1(a){
if(a!=null){
if(a.length){
alert("array";
}else{
alert("is not array")
}
}
}
出来的结果是"array"
--------------------------
<script>
var a=new Array(1,2,3);
var b=2;
var c="2eee";document.write(" The type of is " + typeof(a) );
document.write(" The type of is " + typeof(b) );
document.write(" The type of is " + typeof(c) );
//alert(a.length); if(c!=null){
if(c.length){
alert("array");
}else{
alert("is not array")
}
}
</script>