代码如下:
<script type="text/javascript">
var person={
name:'imooc'
};
var people=[{name:'imooc'}];
var morepeople=[person];
document.write(people.indexOf(person));//-1
document.write(morepeople.indexOf(person));//0
</script>求解:为什么前后两者返回索引值不同?
添加回答
举报
0/150
提交
取消