题解 | #新数组#
新数组
https://www.nowcoder.com/practice/bee781a51bc944bbad20f3c2ca798890
const _delete = (array, index) => {
if (index < 0 || index >= array.length) {
return array; // 如果索引无效,返回原数组
}
return array.filter((_, i) => i !== index); }; _delete([1,2,3],2)

