Array.prototype.toSpliced(start, deleteCount?, ...items) returns a new array after removing, inserting, or replacing elements at start. The original array stays unchanged. Same idea as splice(), but immutable—and the return value is the new full array, not the deleted items.
Remove first. Drop "banana" and "orange" at index 1 in the copy.
Insert next. Place "grape" and "melon" in that gap.
One call. Replace is remove + insert together.
Original untouched.fruits still has banana and orange.
Compatibility
Browser & Runtime Support
Array.prototype.toSpliced() was added in ES2023 with the other immutable array helpers (toReversed, toSorted, with).
✓ Baseline · ES2023
Array.prototype.toSpliced()
Supported in Chrome 110+, Firefox 115+, Safari 16+, Edge 110+, and Node.js 20+. Not available in Internet Explorer or very old browsers.
92%Modern browsers
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
Array.toSpliced()Good
Bottom line: For older targets, feature-detect with if ("toSpliced" in Array.prototype) or fall back to const copy = arr.slice(); copy.splice(...); return copy;.
Frequently Asked Questions
toSpliced(start, deleteCount?, ...items) returns a new array after removing, inserting, or replacing elements at start. The original array is left unchanged.
No. toSpliced() always returns a new array. Assign the result: const next = arr.toSpliced(1, 2). Ignoring the return does nothing useful.
splice() mutates in place and returns an array of the deleted elements. toSpliced() does not mutate and returns the new full array after the edit—not the deleted items.
Set deleteCount to 0: arr.toSpliced(index, 0, item1, item2). You get a new array with those items inserted; the original stays the same.
Like splice(), omitting deleteCount removes from start through the end of the array in the copy. Prefer passing an explicit deleteCount for clarity.
toSpliced() is ES2023. It works in Chrome 110+, Firefox 115+, Safari 16+, Edge 110+, and Node.js 20+. For older environments, copy with slice/spread then splice the copy.