diff --git a/snippets/filterNonUnique.md b/snippets/filterNonUnique.md index f1b93b0f7..6acc4a660 100644 --- a/snippets/filterNonUnique.md +++ b/snippets/filterNonUnique.md @@ -7,7 +7,7 @@ lastUpdated: 2020-11-02T19:40:45+02:00 Creates an array with the non-unique values filtered out. -- Use `new Set()` and the spread operator (`...`) to create an array of the unique values in `arr`. +- Use the `Set` constructor and the spread operator (`...`) to create an array of the unique values in `arr`. - Use `Array.prototype.filter()` to create an array containing only the unique values. ```js diff --git a/snippets/filterUnique.md b/snippets/filterUnique.md index e47fa6a80..e4d2f09a8 100644 --- a/snippets/filterUnique.md +++ b/snippets/filterUnique.md @@ -7,7 +7,7 @@ lastUpdated: 2020-11-02T19:41:00+02:00 Creates an array with the unique values filtered out. -- Use `new Set()` and the spread operator (`...`) to create an array of the unique values in `arr`. +- Use the `Set` constructor and the spread operator (`...`) to create an array of the unique values in `arr`. - Use `Array.prototype.filter()` to create an array containing only the non-unique values. ```js diff --git a/snippets/frozenSet.md b/snippets/frozenSet.md index 94547a650..4e9cafe4c 100644 --- a/snippets/frozenSet.md +++ b/snippets/frozenSet.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-11T11:52:48+03:00 Creates a frozen `Set` object. -- Use the `new Set()` constructor to create a new `Set` object from `iterable`. +- Use the `Set` constructor to create a new `Set` object from `iterable`. - Set the `add`, `delete` and `clear` methods of the newly created object to `undefined`, so that they cannot be used, practically freezing the object. ```js @@ -21,6 +21,6 @@ const frozenSet = iterable => { ``` ```js -frozenSet([1, 2, 3, 1, 2]); +frozenSet([1, 2, 3, 1, 2]); // Set { 1, 2, 3, add: undefined, delete: undefined, clear: undefined } ``` diff --git a/snippets/isDisjoint.md b/snippets/isDisjoint.md index 42cdff2a7..609433fe0 100644 --- a/snippets/isDisjoint.md +++ b/snippets/isDisjoint.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-11T11:53:01+03:00 Checks if the two iterables are disjointed (have no common values). -- Use the `new Set()` constructor to create a new `Set` object from each iterable. +- Use the `Set` constructor to create a new `Set` object from each iterable. - Use `Array.prototype.every()` and `Set.prototype.has()` to check that the two iterables have no common values. ```js diff --git a/snippets/subSet.md b/snippets/subSet.md index 59581bcb6..259928d18 100644 --- a/snippets/subSet.md +++ b/snippets/subSet.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:30+03:00 Checks if the first iterable is a subset of the second one, excluding duplicate values. -- Use the `new Set()` constructor to create a new `Set` object from each iterable. +- Use the `Set` constructor to create a new `Set` object from each iterable. - Use `Array.prototype.every()` and `Set.prototype.has()` to check that each value in the first iterable is contained in the second one. ```js diff --git a/snippets/superSet.md b/snippets/superSet.md index 19ac0088f..16fac9c9d 100644 --- a/snippets/superSet.md +++ b/snippets/superSet.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:30+03:00 Checks if the first iterable is a superset of the second one, excluding duplicate values. -- Use the `new Set()` constructor to create a new `Set` object from each iterable. +- Use the `Set` constructor to create a new `Set` object from each iterable. - Use `Array.prototype.every()` and `Set.prototype.has()` to check that each value in the second iterable is contained in the first one. ```js diff --git a/snippets/symmetricDifference.md b/snippets/symmetricDifference.md index eaf39cf29..16f2168a5 100644 --- a/snippets/symmetricDifference.md +++ b/snippets/symmetricDifference.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:30+03:00 Returns the symmetric difference between two arrays, without filtering out duplicate values. -- Create a `new Set()` from each array to get the unique values of each one. +- Create a `Set` from each array to get the unique values of each one. - Use `Array.prototype.filter()` on each of them to only keep values not contained in the other. ```js diff --git a/snippets/symmetricDifferenceBy.md b/snippets/symmetricDifferenceBy.md index f5b0c7181..b2eec29b0 100644 --- a/snippets/symmetricDifferenceBy.md +++ b/snippets/symmetricDifferenceBy.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:30+03:00 Returns the symmetric difference between two arrays, after applying the provided function to each array element of both. -- Create a `new Set()` from each array to get the unique values of each one after applying `fn` to them. +- Create a `Set` from each array to get the unique values of each one after applying `fn` to them. - Use `Array.prototype.filter()` on each of them to only keep values not contained in the other. ```js diff --git a/snippets/union.md b/snippets/union.md index 315cb2221..107df28e7 100644 --- a/snippets/union.md +++ b/snippets/union.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:44+03:00 Returns every element that exists in any of the two arrays at least once. -- Create a `new Set()` with all values of `a` and `b` and convert it to an array. +- Create a `Set` with all values of `a` and `b` and convert it to an array. ```js const union = (a, b) => Array.from(new Set([...a, ...b])); diff --git a/snippets/unionBy.md b/snippets/unionBy.md index 9d10bca36..0ebf48124 100644 --- a/snippets/unionBy.md +++ b/snippets/unionBy.md @@ -7,8 +7,8 @@ lastUpdated: 2020-10-22T20:24:44+03:00 Returns every element that exists in any of the two arrays at least once, after applying the provided function to each array element of both. -- Create a `new Set()` by applying all `fn` to all values of `a`. -- Create a `new Set()` from `a` and all elements in `b` whose value, after applying `fn` does not match a value in the previously created set. +- Create a `Set` by applying all `fn` to all values of `a`. +- Create a `Set` from `a` and all elements in `b` whose value, after applying `fn` does not match a value in the previously created set. - Return the last set converted to an array. ```js diff --git a/snippets/unionWith.md b/snippets/unionWith.md index 8d1ffd011..fe70c3c0f 100644 --- a/snippets/unionWith.md +++ b/snippets/unionWith.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:44+03:00 Returns every element that exists in any of the two arrays at least once, using a provided comparator function. -- Create a `new Set()` with all values of `a` and values in `b` for which the comparator finds no matches in `a`, using `Array.prototype.findIndex()`. +- Create a `Set` with all values of `a` and values in `b` for which the comparator finds no matches in `a`, using `Array.prototype.findIndex()`. ```js const unionWith = (a, b, comp) => diff --git a/snippets/uniqueElements.md b/snippets/uniqueElements.md index 227d3adfc..50bd8baca 100644 --- a/snippets/uniqueElements.md +++ b/snippets/uniqueElements.md @@ -7,7 +7,7 @@ lastUpdated: 2020-10-22T20:24:44+03:00 Finds all unique values in an array. -- Create a `new Set()` from the given array to discard duplicated values. +- Create a `Set` from the given array to discard duplicated values. - Use the spread operator (`...`) to convert it back to an array. ```js diff --git a/snippets/uniqueSymmetricDifference.md b/snippets/uniqueSymmetricDifference.md index abdad44bf..bfce655cb 100644 --- a/snippets/uniqueSymmetricDifference.md +++ b/snippets/uniqueSymmetricDifference.md @@ -8,7 +8,7 @@ lastUpdated: 2020-10-22T20:24:44+03:00 Returns the unique symmetric difference between two arrays, not containing duplicate values from either array. - Use `Array.prototype.filter()` and `Array.prototype.includes()` on each array to remove values contained in the other. -- Create a `new Set()` from the results, removing duplicate values. +- Create a `Set` from the results, removing duplicate values. ```js const uniqueSymmetricDifference = (a, b) => [