# Unify .slice and splice approaches

**URL:** <https://es.discourse.group/t/unify-slice-and-splice-approaches/1900>\
**Category:** 💡 Ideas\
**Created:** [January 18, 2024, 12:42pm UTC](https://es.discourse.group/t/unify-slice-and-splice-approaches/1900 "2024-01-18T12:42:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaroslav.tavgen](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/jaroslav.tavgen/32/2732_2.png) [@jaroslav.tavgen](https://es.discourse.group/u/jaroslav.tavgen)\
**Post date:** [January 18, 2024, 12:42pm UTC](https://es.discourse.group/t/unify-slice-and-splice-approaches/1900/1 "2024-01-18T12:42:05Z")

</div>

Today it is array.slice(start, end) and array.splice(start, length). It should be one way or another - but in both cases.

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [January 18, 2024, 5:14pm UTC](https://es.discourse.group/t/unify-slice-and-splice-approaches/1900/2 "2024-01-18T17:14:01Z")

</div>

They're different - slice creates a new array and does not mutate; splice mutates. While toSpliced now exists, they're still conceptually different in that slice creates an array of the same or smaller size; splice is for adding and removing elements at a specific position.

The similarity of the names is unfortunate, but irrelevant.
