diff --git a/snippets/shank.md b/snippets/shank.md index 9a2a2d032..1f5b2e25f 100644 --- a/snippets/shank.md +++ b/snippets/shank.md @@ -1,6 +1,6 @@ ### shank -Has the same functionality as [`Array.prototype.prototype.splice()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice), but returning a new array instead of mutating the original array. +Has the same functionality as [`Array.prototype.splice()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice), but returning a new array instead of mutating the original array. Use `Array.prototype.slice()` and `Array.prototype.concat()` to get a new array with the new contents after removing existing elements and/or adding new elements. Omit the second argument, `index`, to start at `0`. @@ -21,4 +21,3 @@ const namesAndDelta = shank(names, 1, 0, 'delta'); // [ 'alpha', 'delta', 'bravo const namesNoBravo = shank(names, 1, 1); // [ 'alpha', 'charlie' ] console.log(names); // ['alpha', 'bravo', 'charlie'] ``` - diff --git a/snippets/toHash.md b/snippets/toHash.md index 9211992e2..002fe8e92 100644 --- a/snippets/toHash.md +++ b/snippets/toHash.md @@ -2,7 +2,7 @@ Reduces a given Array-like into a value hash (keyed data store). -Given an Iterable or Array-like structure, call `Array.prototype.prototype.reduce.call()` on the provided object to step over it and return an Object, keyed by the reference value. +Given an Iterable or Array-like structure, call `Array.prototype.reduce.call()` on the provided object to step over it and return an Object, keyed by the reference value. ```js const toHash = (object, key) =>