diff --git a/snippets/URLJoin.md b/snippets/URLJoin.md index dc9ba9e4b..18af73caf 100644 --- a/snippets/URLJoin.md +++ b/snippets/URLJoin.md @@ -10,7 +10,7 @@ lastUpdated: 2020-10-22T20:24:44+03:00 Joins all given URL segments together, then normalizes the resulting URL. - Use `String.prototype.join()` to combine URL segments. -- Use a series of `String.prototype.replace()` calls with various regexps to normalize the resulting URL (remove double slashes, add proper slashes for protocol, remove slashes before parameters, combine parameters with `'&'` and normalize first parameter delimiter). +- Use a series of `String.prototype.replace()` calls with various regular expressions to normalize the resulting URL (remove double slashes, add proper slashes for protocol, remove slashes before parameters, combine parameters with `'&'` and normalize first parameter delimiter). ```js const URLJoin = (...args) => diff --git a/snippets/mapConsecutive.md b/snippets/mapConsecutive.md index 60cbc3b31..5688e6361 100644 --- a/snippets/mapConsecutive.md +++ b/snippets/mapConsecutive.md @@ -7,7 +7,7 @@ cover: blog_images/cold-mountains.jpg firstSeen: 2021-08-08T05:00:00-04:00 --- -Maps each block of `n` consencutive elements using the given function, `fn`. +Maps each block of `n` consecutive elements using the given function, `fn`. - Use `Array.prototype.slice()` to get `arr` with `n` elements removed from the left. - Use `Array.prototype.map()` and `Array.prototype.slice()` to apply `fn` to each block of `n` consecutive elements in `arr`. diff --git a/snippets/quickSort.md b/snippets/quickSort.md index 86e1263d2..f463266f6 100644 --- a/snippets/quickSort.md +++ b/snippets/quickSort.md @@ -14,7 +14,7 @@ Sorts an array of numbers, using the quicksort algorithm. - Use the spread operator (`...`) to clone the original array, `arr`. - If the `length` of the array is less than `2`, return the cloned array. - Use `Math.floor()` to calculate the index of the pivot element. -- Use `Array.prototype.reduce()` and `Array.prototype.push()` to split the array into two subarrays. The first one contains elements smaller than or equal to `pivot` and the second on elements greather than it. Destructure the result into two arrays. +- Use `Array.prototype.reduce()` and `Array.prototype.push()` to split the array into two subarrays. The first one contains elements smaller than or equal to `pivot` and the second on elements greater than it. Destructure the result into two arrays. - Recursively call `quickSort()` on the created subarrays. ```js