代码如下: <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>
求解:为什么前后两者返回索引值不同?
化龙贝
相关分类