js數組刪除(splice和delete)

今天用到了數組的刪除,分別使用了splice和delete方法,記錄一下,方便下次查找。數組 原數組是一個關聯數組,如spa var test=[]; test[1]={name:'1',age:1}; test[2]={name:'2',age:2}; test[4]={name:'3',age:3};3d console.log(test)code 長度爲5的關聯數組,如今開始刪除。blog
相關文章
相關標籤/搜索