Fix typos in descriptions
This commit is contained in:
@ -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) =>
|
||||
|
||||
@ -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) => {
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -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 = '_') =>
|
||||
|
||||
@ -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 =>
|
||||
|
||||
@ -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`.
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user