diff --git a/snippets/capitalize.md b/snippets/capitalize.md index f29c933d2..d085a3034 100644 --- a/snippets/capitalize.md +++ b/snippets/capitalize.md @@ -3,7 +3,7 @@ Capitalizes the first letter of a string. Use destructuring and `toUpperCase()` to capitalize first letter, `...rest` to get array of characters after first letter and then `Array.join('')` to make it a string again. -Omit the `lowerRest` parameter to keep the rest of the string intact, or set it to `true` to convert to lower case. +Omit the `lowerRest` parameter to keep the rest of the string intact, or set it to `true` to convert to lowercase. ```js const capitalize = ([first,...rest], lowerRest = false) => diff --git a/snippets/cleanObj.md b/snippets/cleanObj.md index 8ba4058ed..75a8e900b 100644 --- a/snippets/cleanObj.md +++ b/snippets/cleanObj.md @@ -3,7 +3,7 @@ Removes any properties except the ones specified from a JSON object. Use `Object.keys()` method to loop over given json object and deleting keys that are not `include`d in given array. -also if you give it a special key(`childIndicator`) it will search deeply inside it to apply function to inner objects too. +Also if you give it a special key (`childIndicator`) it will search deeply inside it to apply function to inner objects too. ```js const cleanObj = (obj, keysToKeep = [], childIndicator) => { diff --git a/snippets/countOccurrences.md b/snippets/countOccurrences.md index be28947f0..f55de0a62 100644 --- a/snippets/countOccurrences.md +++ b/snippets/countOccurrences.md @@ -1,6 +1,6 @@ ### countOccurrences -Counts the occurences of a value in an array. +Counts the occurrences of a value in an array. Use `Array.reduce()` to increment a counter each time you encounter the specific value inside the array. diff --git a/snippets/fromCamelCase.md b/snippets/fromCamelCase.md index e9c61f1ba..e004e67ef 100644 --- a/snippets/fromCamelCase.md +++ b/snippets/fromCamelCase.md @@ -3,7 +3,7 @@ Converts a string from camelcase. Use `replace()` to remove underscores, hyphens and spaces and convert words to camelcase. -Omit the scond argument to use a default separator of `_`. +Omit the second argument to use a default separator of `_`. ```js const fromCamelCase = (str, separator = '_') => diff --git a/snippets/getType.md b/snippets/getType.md index 3110871fb..53f660420 100644 --- a/snippets/getType.md +++ b/snippets/getType.md @@ -2,7 +2,7 @@ Returns the native type of a value. -Returns lower-cased constructor name of value, "undefined" or "null" if value is undefined or null +Returns lowercased constructor name of value, "undefined" or "null" if value is undefined or null ```js const getType = v => diff --git a/snippets/initializeArrayWithRange.md b/snippets/initializeArrayWithRange.md index d90de1136..75dbc8adf 100644 --- a/snippets/initializeArrayWithRange.md +++ b/snippets/initializeArrayWithRange.md @@ -1,6 +1,6 @@ ### initializeArrayWithRange -Initialized an array containing the numbers in the specified range. +Initializes an array containing the numbers in the specified range. Use `Array(end-start)` to create an array of the desired length, `Array.map()` to fill with the desired values in a range. You can omit `start` to use a default value of `0`. diff --git a/snippets/readFileLines.md b/snippets/readFileLines.md index 288c2ebf8..6433c6059 100644 --- a/snippets/readFileLines.md +++ b/snippets/readFileLines.md @@ -4,7 +4,7 @@ Returns an array of lines from the specified file. Use `readFileSync` function in `fs` node package to create a `Buffer` from a file. convert buffer to string using `toString(encoding)` function. -creating an array from contents of file by `split`ing file content line by line(each `\n`). +creating an array from contents of file by `split`ing file content line by line (each `\n`). ```js const fs = require('fs'); diff --git a/snippets/take.md b/snippets/take.md index 85802f6a8..f6afa5dab 100644 --- a/snippets/take.md +++ b/snippets/take.md @@ -1,6 +1,6 @@ ### take -Returns an array with n elements removed from the beggining. +Returns an array with n elements removed from the beginning. Use `Array.slice()` to create a slice of the array with `n` elements taken from the beginning.