首页 / 数码百科 / 正文

delete vue.delete的区别

时间:2024-10-04 19:01:02

导读:delete和vue.delete的区别 let arr1 = [1,2,3] let arr2 = [1,2,3] delete arr1[1] this.$delete(arr2,2) console.log(arr1) console.log(arr2) delte会删除数组......

deletevue.delete区别

let arr1 = [1,2,3] let arr2 = [1,2,3] delete arr1[1] this.$delete(arr2,2) console.log(arr1) console.log(arr2)

delte会删除数组的值,但是它依然会在内存中占位置

而vue.delete会删除数组在内存中的占位

版权声明:转载此文是出于传递更多信息之目的。若有来源标注错误或侵犯了您的合法权益,请作者持权属证明与本网联系,我们将及时更正、