๐arr.splice()
โญ๏ธ ๆณจๆ๏ผarr.splice() ๆๆชๆทๅ้ฃๅใๆๅ ฅๆฐๅ ็ด ๏ผไธฆๅๅณใ่ขซๆชๆ็้จๅใโ๏ธ)
// splice here โด
// 0 1 | 2 3
let fish = ['angel', 'clown', 'mandarin', 'sturgeon']
// โฐโโ โญ๏ธ fish โโโโฏ โฐโโโโ โญ๏ธ removed โโโโโโฏ
// (after splice)
// fish === ['angel', 'clown'] // โญ๏ธ original arr
let removed = fish.splice(2) // "removed" will be returned
Last updated
Was this helpful?