<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/splice-in-javascript-nvfej9tlb" -->

---
title: Splice in JavaScript | daily.dev
description: Splice method changes the content of the array in place. It can be used to add or remove items from the array. Splice always returns an array containing the...
canonical: https://daily.dev/posts/splice-in-javascript-nvfej9tlb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Splice in JavaScript | daily.dev
og:description: Splice method changes the content of the array in place. It can be used to add or remove items from the array. Splice always returns an array containing the...
og:url: https://daily.dev/posts/splice-in-javascript-nvfej9tlb
og:image: https://api.daily.dev/og/posts/Nvfej9tlB.png
og:image:alt: Splice in JavaScript
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Splice in JavaScript

**[gitconnected](https://daily.dev/sources/gc)** · 2 min read · 10 upvotes · 2 comments

## Summary

Splice method changes the content of the array in place. It can be used to add or remove items from the array. Splice always returns an array containing the deleted elements. The method is available in javascript and in JavaScript 7.0 and above. It is also available in Ruby and Python.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://levelup.gitconnected.com/splice-in-javascript-bb289f360c6d>

## Community discussion

Top comments from developers on daily.dev.

**@lorezz** · 0 upvotes

> Love splice, really useful the -index to access from the end.

**@webdevnetix** · 0 upvotes

> Nice examples, but the latest thing isn't very effective (splice method is too slowest against of push method). But that show all of possibilities of this super method ;)

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/splice-in-javascript-nvfej9tlb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Splice in JavaScript","url":"https://daily.dev/posts/splice-in-javascript-nvfej9tlb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/splice-in-javascript-nvfej9tlb"},"datePublished":"2021-06-29T00:30:41.183Z","dateModified":"2021-10-07T14:17:10.317Z","description":"Splice method changes the content of the array in place. It can be used to add or remove items from the array. Splice always returns an array containing the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cedfe27efa2b8888d76b1fecbbfbb117","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cedfe27efa2b8888d76b1fecbbfbb117","isAccessibleForFree":true,"articleSection":"gitconnected","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"gitconnected","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/gc","url":"https://daily.dev/sources/gc"},"commentCount":2,"discussionUrl":"https://daily.dev/posts/splice-in-javascript-nvfej9tlb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":10},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"keywords":"javascript","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"gitconnected","item":"https://daily.dev/sources/gc"},{"@type":"ListItem","position":3,"name":"Splice in JavaScript"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/splice-in-javascript-nvfej9tlb","comment":[{"@type":"Comment","text":"Love splice, really useful the -index to access from the end.","datePublished":"2021-06-29T06:53:06.428Z","url":"https://daily.dev/posts/Nvfej9tlB#c-s5BiP7glc","author":{"@type":"Person","name":"lorezz","url":"https://daily.dev/lorezz","image":"https://avatars0.githubusercontent.com/u/1153066?v=4"}},{"@type":"Comment","text":"Nice examples, but the latest thing isn’t very effective (splice method is too slowest against of push method). But that show all of possibilities of this super method ;)","datePublished":"2021-06-30T06:53:45.580Z","url":"https://daily.dev/posts/Nvfej9tlB#c-y_6YLFAPv","author":{"@type":"Person","name":"WebNT","url":"https://daily.dev/webdevnetix","image":"https://lh3.googleusercontent.com/a/AATXAJxpt463aPatL98R__-r_qhZkmvEfxSBqsGwwTBE=s100"}}]}
```

