摘要: 题目是群中小伙伴出的。var a = [1,2,3]; c= a//todo 限制条件 c 不能出现在 = 左边console.log(a)console.log(c)console.log(a === c)在todo中写段代码 执行[][]true我想到的答案1. a.length = 02. 群中其他人的答案 a.splice(0,a.length)想到的错误办法:1. a = [] //因为array是引用类型,a = [] ,只是指向一个新的array,c还是指向老的array2. for(var i = 0 ; i < a.length ; i ++){delete a[i]} 阅读全文
posted @ 2014-02-21 16:38 星堡a 阅读(232) 评论(0) 推荐(0) 编辑