diff --git a/snippets/URLJoin.md b/snippets/URLJoin.md index 000a2fdc1..e7d3febf1 100644 --- a/snippets/URLJoin.md +++ b/snippets/URLJoin.md @@ -7,7 +7,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 `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). ```js diff --git a/snippets/reverseString.md b/snippets/reverseString.md index 9bcad298e..5ba3f45a1 100644 --- a/snippets/reverseString.md +++ b/snippets/reverseString.md @@ -8,7 +8,7 @@ lastUpdated: 2020-10-18T14:58:09+03:00 Reverses a string. - Use the spread operator (`...`) and `Array.prototype.reverse()` to reverse the order of the characters in the string. -- Combine characters to get a string using `String.prototype.join('')`. +- Combine characters to get a string using `String.prototype.join()`. ```js const reverseString = str => [...str].reverse().join(''); diff --git a/snippets/sdbm.md b/snippets/sdbm.md index ddddb872e..aa9eaf648 100644 --- a/snippets/sdbm.md +++ b/snippets/sdbm.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:30+03:00 Hashes the input string into a whole number. -- Use `String.prototype.split('')` and `Array.prototype.reduce()` to create a hash of the input string, utilizing bit shifting. +- Use `String.prototype.split()` and `Array.prototype.reduce()` to create a hash of the input string, utilizing bit shifting. ```js const sdbm = str => { diff --git a/snippets/size.md b/snippets/size.md index d0050561d..5420092d4 100644 --- a/snippets/size.md +++ b/snippets/size.md @@ -11,7 +11,7 @@ Gets the size of an array, object or string. - Use `Array.prototype.length` property for arrays. - Use `length` or `size` value if available or number of keys for objects. - Use `size` of a [`Blob` object](https://developer.mozilla.org/en-US/docs/Web/API/Blob) created from `val` for strings. -- Split strings into array of characters with `String.prototype.split('')` and return its length. +- Split strings into array of characters with `String.prototype.split()` and return its length. ```js diff --git a/snippets/sortCharactersInString.md b/snippets/sortCharactersInString.md index 47fed629c..bbf8904b1 100644 --- a/snippets/sortCharactersInString.md +++ b/snippets/sortCharactersInString.md @@ -8,7 +8,7 @@ lastUpdated: 2020-10-22T20:24:30+03:00 Alphabetically sorts the characters in a string. - Use the spread operator (`...`), `Array.prototype.sort()` and `String.prototype.localeCompare()` to sort the characters in `str`. -- Recombine using `String.prototype.join('')`. +- Recombine using `String.prototype.join()`. ```js const sortCharactersInString = str => diff --git a/snippets/unflattenObject.md b/snippets/unflattenObject.md index f7efa6d04..9a2faf4ca 100644 --- a/snippets/unflattenObject.md +++ b/snippets/unflattenObject.md @@ -8,7 +8,7 @@ lastUpdated: 2020-10-22T20:24:44+03:00 Unflatten an object with the paths for keys. - Use nested `Array.prototype.reduce()` to convert the flat path to a leaf node. -- Use `String.prototype.split('.')` to split each key with a dot delimiter and `Array.prototype.reduce()` to add objects against the keys. +- Use `String.prototype.split()` to split each key with a dot delimiter and `Array.prototype.reduce()` to add objects against the keys. - If the current accumulator already contains a value against a particular key, return its value as the next accumulator. - Otherwise, add the appropriate key-value pair to the accumulator object and return the value as the accumulator.