diff --git a/snippets/addDaysToDate.md b/snippets/addDaysToDate.md index 3f2131fd2..d1a625c1e 100644 --- a/snippets/addDaysToDate.md +++ b/snippets/addDaysToDate.md @@ -5,7 +5,7 @@ tags: date,intermediate Calculates the date of `n` days from the given date, returning its string representation. -- Use `new Date()` to create a date object from the first parameter. +- Use `new Date()` to create a date object from the first argument. - Use `Date.prototype.getDate()` and `Date.prototype.setDate()` to add `n` days to the given date. - Use `Date.prototype.toISOString()` to return a string in `yyyy-mm-dd` format. diff --git a/snippets/approximatelyEqual.md b/snippets/approximatelyEqual.md index 2bb46b686..9165fc8fc 100644 --- a/snippets/approximatelyEqual.md +++ b/snippets/approximatelyEqual.md @@ -6,7 +6,7 @@ tags: math,beginner Checks if two numbers are approximately equal to each other. - Use `Math.abs()` to compare the absolute difference of the two values to `epsilon`. -- Omit the third parameter, `epsilon`, to use a default value of `0.001`. +- Omit the third argument, `epsilon`, to use a default value of `0.001`. ```js const approximatelyEqual = (v1, v2, epsilon = 0.001) => diff --git a/snippets/bifurcate.md b/snippets/bifurcate.md index bfa307628..ba7bc7c03 100644 --- a/snippets/bifurcate.md +++ b/snippets/bifurcate.md @@ -17,6 +17,6 @@ const bifurcate = (arr, filter) => ``` ```js -bifurcate(['beep', 'boop', 'foo', 'bar'], [true, true, false, true]); +bifurcate(['beep', 'boop', 'foo', 'bar'], [true, true, false, true]); // [ ['beep', 'boop', 'bar'], ['foo'] ] ``` diff --git a/snippets/bifurcateBy.md b/snippets/bifurcateBy.md index 75d0b9b06..1ed241c97 100644 --- a/snippets/bifurcateBy.md +++ b/snippets/bifurcateBy.md @@ -17,5 +17,6 @@ const bifurcateBy = (arr, fn) => ``` ```js -bifurcateBy(['beep', 'boop', 'foo', 'bar'], x => x[0] === 'b'); // [ ['beep', 'boop', 'bar'], ['foo'] ] +bifurcateBy(['beep', 'boop', 'foo', 'bar'], x => x[0] === 'b'); +// [ ['beep', 'boop', 'bar'], ['foo'] ] ``` diff --git a/snippets/capitalize.md b/snippets/capitalize.md index d9187b7a7..509a1b555 100644 --- a/snippets/capitalize.md +++ b/snippets/capitalize.md @@ -7,7 +7,7 @@ Capitalizes the first letter of a string. - Use array destructuring and `String.prototype.toUpperCase()` to capitalize the first letter of the string. - Use `Array.prototype.join('')` to combine the capitalized `first` with the `...rest` of the characters. -- Omit the `lowerRest` parameter to keep the rest of the string intact, or set it to `true` to convert to lowercase. +- Omit the `lowerRest` argument 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/celsiusToFahrenheit.md b/snippets/celsiusToFahrenheit.md index fe29f227c..9ea34171e 100644 --- a/snippets/celsiusToFahrenheit.md +++ b/snippets/celsiusToFahrenheit.md @@ -5,7 +5,7 @@ tags: math,beginner Converts Celsius to Fahrenheit. -- Follows the conversion formula `F = 1.8 * C + 32`. +- Follow the conversion formula `F = 1.8 * C + 32`. ```js const celsiusToFahrenheit = degrees => 1.8 * degrees + 32; diff --git a/snippets/checkProp.md b/snippets/checkProp.md index fcb7b6f30..719ce4a14 100644 --- a/snippets/checkProp.md +++ b/snippets/checkProp.md @@ -1,6 +1,6 @@ --- title: checkProp -tags: function,object,beginner +tags: function,object,intermediate --- Creates a function that will invoke a predicate function for the specified property on a given object. diff --git a/snippets/counter.md b/snippets/counter.md index 8f41068c6..8b4b3721c 100644 --- a/snippets/counter.md +++ b/snippets/counter.md @@ -8,8 +8,8 @@ Creates a counter with the specified range, step and duration for the specified - Check if `step` has the proper sign and change it accordingly. - Use `setInterval()` in combination with `Math.abs()` and `Math.floor()` to calculate the time between each new text draw. - Use `Document.querySelector()`, `Element.innerHTML` to update the value of the selected element. -- Omit the fourth parameter, `step`, to use a default step of `1`. -- Omit the fifth parameter, `duration`, to use a default duration of `2000`ms. +- Omit the fourth argument, `step`, to use a default step of `1`. +- Omit the fifth argument, `duration`, to use a default duration of `2000`ms. ```js const counter = (selector, start, end, step = 1, duration = 2000) => { diff --git a/snippets/dayName.md b/snippets/dayName.md index 842c63aaf..2344faa13 100644 --- a/snippets/dayName.md +++ b/snippets/dayName.md @@ -6,7 +6,7 @@ tags: date,beginner Gets the name of the weekday from a `Date` object. - Use `Date.prototype.toLocaleDateString()` with the `{ weekday: 'long' }` option to retrieve the weekday. -- Use the optional second parameter to get a language-specific name or omit it to use the default locale. +- Use the optional second argument to get a language-specific name or omit it to use the default locale. ```js const dayName = (date, locale) => diff --git a/snippets/decapitalize.md b/snippets/decapitalize.md index 01a1292a0..14565b15f 100644 --- a/snippets/decapitalize.md +++ b/snippets/decapitalize.md @@ -6,7 +6,7 @@ tags: string,intermediate Decapitalizes the first letter of a string. - Use array destructuring and `String.prototype.toLowerCase()` to decapitalize first letter, `...rest` to get array of characters after first letter and then `Array.prototype.join('')` to make it a string again. -- Omit the `upperRest` parameter to keep the rest of the string intact, or set it to `true` to convert to uppercase. +- Omit the `upperRest` argument to keep the rest of the string intact, or set it to `true` to convert to uppercase. ```js const decapitalize = ([first, ...rest], upperRest = false) => diff --git a/snippets/drop.md b/snippets/drop.md index 4d5c77169..c89dd2f86 100644 --- a/snippets/drop.md +++ b/snippets/drop.md @@ -6,6 +6,7 @@ tags: array,beginner Creates a new array with `n` elements removed from the left. - Use `Array.prototype.slice()` to remove the specified number of elements from the left. +- Omit the last argument, `n`, to use a default value of `1`. ```js const drop = (arr, n = 1) => arr.slice(n); diff --git a/snippets/dropRight.md b/snippets/dropRight.md index 33fbb849a..b38f9704d 100644 --- a/snippets/dropRight.md +++ b/snippets/dropRight.md @@ -6,13 +6,14 @@ tags: array,beginner Creates a new array with `n` elements removed from the right. - Use `Array.prototype.slice()` to remove the specified number of elements from the right. +- Omit the last argument, `n`, to use a default value of `1`. ```js const dropRight = (arr, n = 1) => arr.slice(0, -n); ``` ```js -dropRight([1, 2, 3]); // [1,2] +dropRight([1, 2, 3]); // [1, 2] dropRight([1, 2, 3], 2); // [1] dropRight([1, 2, 3], 42); // [] ``` diff --git a/snippets/fahrenheitToCelsius.md b/snippets/fahrenheitToCelsius.md index fd24ca6cf..b17656336 100644 --- a/snippets/fahrenheitToCelsius.md +++ b/snippets/fahrenheitToCelsius.md @@ -5,7 +5,7 @@ tags: math,beginner Converts Fahrenheit to Celsius. -- Follows the conversion formula `C = (F - 32) * 5/9`. +- Follow the conversion formula `C = (F - 32) * 5/9`. ```js const fahrenheitToCelsius = degrees => (degrees - 32) * 5 / 9; diff --git a/snippets/inRange.md b/snippets/inRange.md index fc911631f..1f325ae61 100644 --- a/snippets/inRange.md +++ b/snippets/inRange.md @@ -6,7 +6,7 @@ tags: math,beginner Checks if the given number falls within the given range. - Use arithmetic comparison to check if the given number is in the specified range. -- If the second parameter, `end`, is not specified, the range is considered to be from `0` to `start`. +- If the second argument, `end`, is not specified, the range is considered to be from `0` to `start`. ```js const inRange = (n, start, end = null) => { diff --git a/snippets/indentString.md b/snippets/indentString.md index c4d7f632c..671c89d97 100644 --- a/snippets/indentString.md +++ b/snippets/indentString.md @@ -6,7 +6,7 @@ tags: string,beginner Indents each line in the provided string. - Use `String.prototype.replace()` and a regular expression to add the character specified by `indent` `count` times at the start of each line. -- Omit the third parameter, `indent`, to use a default indentation character of `' '`. +- Omit the third argument, `indent`, to use a default indentation character of `' '`. ```js const indentString = (str, count, indent = ' ') => diff --git a/snippets/kmToMiles.md b/snippets/kmToMiles.md index 500498250..db4a5de48 100644 --- a/snippets/kmToMiles.md +++ b/snippets/kmToMiles.md @@ -5,7 +5,7 @@ tags: math,beginner Converts kilometers to miles. -- Follows the conversion formula `mi = km * 0.621371`. +- Follow the conversion formula `mi = km * 0.621371`. ```js const kmToMiles = km => km * 0.621371; diff --git a/snippets/milesToKm.md b/snippets/milesToKm.md index 125b5fd69..ded878fc3 100644 --- a/snippets/milesToKm.md +++ b/snippets/milesToKm.md @@ -5,7 +5,7 @@ tags: math,beginner Converts miles to kilometers. -- Follows the conversion formula `km = mi * 1.609344`. +- Follow the conversion formula `km = mi * 1.609344`. ```js const milesToKm = miles => miles * 1.609344; diff --git a/snippets/reduceWhich.md b/snippets/reduceWhich.md index 79f8381e1..6f0552ec3 100644 --- a/snippets/reduceWhich.md +++ b/snippets/reduceWhich.md @@ -6,7 +6,7 @@ tags: array,intermediate Returns the minimum/maximum value of an array, after applying the provided function to set the comparing rule. - Use `Array.prototype.reduce()` in combination with the `comparator` function to get the appropriate element in the array. -- You can omit the second parameter, `comparator`, to use the default one that returns the minimum element in the array. +- Omit the second argument, `comparator`, to use the default one that returns the minimum element in the array. ```js const reduceWhich = (arr, comparator = (a, b) => a - b) =>