摘要:
let arr = ['a','b','c','d']; function move(arrs,from,to) { let arr1 = [...arrs]; let item = arr1.splice(from,1); arr1.splice(to,0,...item); return arr 阅读全文
摘要:
函数内this的指向问题 1 . 非严格模式下,this指向window function sum(a , b) { //非严格模式下,this指向window console.log(this); return a + b } sum(); 2. 严格模式下,this指向undefined fun 阅读全文
摘要:
new Array(3) //表示创建length=3 的空字符数组 Array.of(3) //表示创建length = 1 的数组 let arr1 = new Array(3); let arr2 = Array.of(3); console.log(arr1.length); //3 con 阅读全文