js中的伪数组


伪数组

有length属性,没有数组的pop,push等方法

转为真正的数组 

arr伪数组

1.Array.prototype.slice.call(arr);

2.var arr1=[].slice.call(arr);

3var  arr1=Array.from(arr); 

伪数组转为普通数组

https://blog.csdn.net/sinat_19594515/article/details/101025056

原网站  伪数组

https://www.cnblogs.com/shenjp/p/8051587.html

es6新增 结构赋值 数组方法

var arr=[[],[],[]]

cosole.log(arr)

var a=[1,3,4,5,6]

let [a,b,c]=[11,22,33]

console.log(a)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM