mirror of
https://github.com/jbranchaud/til
synced 2026-01-07 17:18:02 +00:00
Compare commits
2 Commits
53ec73c1ae
...
d3f211773a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3f211773a | ||
|
|
460473a87f |
@@ -15,10 +15,8 @@ const remove = (items,index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const list = [1,2,3,4,5];
|
const list = [1,2,3,4,5];
|
||||||
remove(list, 2);
|
remove(list, 2); // [1,2,4,5]
|
||||||
// [1,2,3,4]
|
// list still [1,2,3,4,5]
|
||||||
list
|
|
||||||
// [1,2,3,4,5]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
It only took a couple lines of code and immutability is baked in.
|
It only took a couple lines of code and immutability is baked in.
|
||||||
|
|||||||
Reference in New Issue
Block a user