diff --git a/javascript/immutable-remove-with-the-spread-operator.md b/javascript/immutable-remove-with-the-spread-operator.md index 3e1db42c..4886ea6f 100644 --- a/javascript/immutable-remove-with-the-spread-operator.md +++ b/javascript/immutable-remove-with-the-spread-operator.md @@ -15,10 +15,8 @@ const remove = (items,index) => { }; const list = [1,2,3,4,5]; -remove(list, 2); -// [1,2,3,4] -list -// [1,2,3,4,5] +remove(list, 2); // [1,2,4,5] +// list still [1,2,3,4,5] ``` It only took a couple lines of code and immutability is baked in.