Re-tag function snippets

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-18 19:42:11 +03:00
parent c2fdfac6ce
commit 8cb9469ff4
25 changed files with 28 additions and 28 deletions

View File

@ -1,6 +1,6 @@
--- ---
title: all title: all
tags: array,function,beginner tags: array,beginner
--- ---
Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise. Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise.

View File

@ -1,6 +1,6 @@
--- ---
title: allEqual title: allEqual
tags: array,function,beginner tags: array,beginner
--- ---
Check if all elements in an array are equal. Check if all elements in an array are equal.

View File

@ -1,6 +1,6 @@
--- ---
title: any title: any
tags: array,function,beginner tags: array,beginner
--- ---
Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise. Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise.

View File

@ -1,6 +1,6 @@
--- ---
title: differenceWith title: differenceWith
tags: array,function,intermediate tags: array,intermediate
--- ---
Filters out all values from an array for which the comparator function does not return `true`. Filters out all values from an array for which the comparator function does not return `true`.
@ -13,4 +13,4 @@ const differenceWith = (arr, val, comp) => arr.filter(a => val.findIndex(b => co
```js ```js
differenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2] differenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b)); // [1, 1.2]
``` ```

View File

@ -1,6 +1,6 @@
--- ---
title: dropRightWhile title: dropRightWhile
tags: array,function,intermediate tags: array,intermediate
--- ---
Removes elements from the end of an array until the passed function returns `true`. Returns the remaining elements in the array. Removes elements from the end of an array until the passed function returns `true`. Returns the remaining elements in the array.

View File

@ -1,6 +1,6 @@
--- ---
title: dropWhile title: dropWhile
tags: array,function,intermediate tags: array,intermediate
--- ---
Removes elements in an array until the passed function returns `true`. Returns the remaining elements in the array. Removes elements in an array until the passed function returns `true`. Returns the remaining elements in the array.

View File

@ -1,6 +1,6 @@
--- ---
title: findKey title: findKey
tags: object,function,intermediate tags: object,intermediate
--- ---
Returns the first key that satisfies the provided testing function. Otherwise `undefined` is returned. Returns the first key that satisfies the provided testing function. Otherwise `undefined` is returned.

View File

@ -1,6 +1,6 @@
--- ---
title: findLastIndex title: findLastIndex
tags: array,function,intermediate tags: array,intermediate
--- ---
Returns the index of the last element for which the provided function returns a truthy value. Returns the index of the last element for which the provided function returns a truthy value.

View File

@ -1,6 +1,6 @@
--- ---
title: findLastKey title: findLastKey
tags: object,function,intermediate tags: object,intermediate
--- ---
Returns the last key that satisfies the provided testing function. Returns the last key that satisfies the provided testing function.

View File

@ -1,6 +1,6 @@
--- ---
title: forEachRight title: forEachRight
tags: array,function,intermediate tags: array,intermediate
--- ---
Executes a provided function once for each array element, starting from the array's last element. Executes a provided function once for each array element, starting from the array's last element.

View File

@ -1,6 +1,6 @@
--- ---
title: intersectionWith title: intersectionWith
tags: array,function,intermediate tags: array,intermediate
--- ---
Returns the elements that exist in both arrays, using a provided comparator function. Returns the elements that exist in both arrays, using a provided comparator function.

View File

@ -1,6 +1,6 @@
--- ---
title: invertKeyValues title: invertKeyValues
tags: object,function,intermediate tags: object,intermediate
--- ---
Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. If a function is supplied, it is applied to each inverted key. Inverts the key-value pairs of an object, without mutating it. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. If a function is supplied, it is applied to each inverted key.

View File

@ -1,6 +1,6 @@
--- ---
title: mapKeys title: mapKeys
tags: object,function,intermediate tags: object,intermediate
--- ---
Creates an object with keys generated by running the provided function for each key and the same values as the provided object. Creates an object with keys generated by running the provided function for each key and the same values as the provided object.

View File

@ -1,6 +1,6 @@
--- ---
title: mapValues title: mapValues
tags: object,function,intermediate tags: object,intermediate
--- ---
Creates an object with the same keys as the provided object and values generated by running the provided function for each value. Creates an object with the same keys as the provided object and values generated by running the provided function for each value.

View File

@ -1,6 +1,6 @@
--- ---
title: matchesWith title: matchesWith
tags: object,type,function,intermediate tags: object,type,intermediate
--- ---
Compares two objects to determine if the first one contains equivalent property values to the second one, based on a provided function. Compares two objects to determine if the first one contains equivalent property values to the second one, based on a provided function.
@ -24,4 +24,4 @@ matchesWith(
{ greeting: 'hi' }, { greeting: 'hi' },
(oV, sV) => isGreeting(oV) && isGreeting(sV) (oV, sV) => isGreeting(oV) && isGreeting(sV)
); // true ); // true
``` ```

View File

@ -1,6 +1,6 @@
--- ---
title: none title: none
tags: array,function,beginner tags: array,beginner
--- ---
Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise. Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise.
@ -15,4 +15,4 @@ const none = (arr, fn = Boolean) => !arr.some(fn);
```js ```js
none([0, 1, 3, 0], x => x == 2); // true none([0, 1, 3, 0], x => x == 2); // true
none([0, 0, 0]); // true none([0, 0, 0]); // true
``` ```

View File

@ -1,6 +1,6 @@
--- ---
title: objectToQueryString title: objectToQueryString
tags: object,function,intermediate tags: object,intermediate
--- ---
Returns a query string generated from the key-value pairs of the given object. Returns a query string generated from the key-value pairs of the given object.

View File

@ -1,6 +1,6 @@
--- ---
title: partition title: partition
tags: array,object,function,intermediate tags: array,object,intermediate
--- ---
Groups the elements into two arrays, depending on the provided function's truthiness for each element. Groups the elements into two arrays, depending on the provided function's truthiness for each element.

View File

@ -1,6 +1,6 @@
--- ---
title: reduceSuccessive title: reduceSuccessive
tags: array,function,intermediate tags: array,intermediate
--- ---
Applies a function against an accumulator and each element in the array (from left to right), returning an array of successively reduced values. Applies a function against an accumulator and each element in the array (from left to right), returning an array of successively reduced values.

View File

@ -1,6 +1,6 @@
--- ---
title: reduceWhich title: reduceWhich
tags: array,function,intermediate tags: array,intermediate
--- ---
Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule. Returns the minimum/maximum value of an array, after applying the provided function to set comparing rule.

View File

@ -1,6 +1,6 @@
--- ---
title: takeRightWhile title: takeRightWhile
tags: array,function,intermediate tags: array,intermediate
--- ---
Removes elements from the end of an array until the passed function returns `true`. Returns the removed elements. Removes elements from the end of an array until the passed function returns `true`. Returns the removed elements.

View File

@ -1,6 +1,6 @@
--- ---
title: takeWhile title: takeWhile
tags: array,function,intermediate tags: array,intermediate
--- ---
Removes elements in an array until the passed function returns `true`. Returns the removed elements. Removes elements in an array until the passed function returns `true`. Returns the removed elements.

View File

@ -1,6 +1,6 @@
--- ---
title: unionWith title: unionWith
tags: array,function,intermediate tags: array,intermediate
--- ---
Returns every element that exists in any of the two arrays once, using a provided comparator function. Returns every element that exists in any of the two arrays once, using a provided comparator function.

View File

@ -1,6 +1,6 @@
--- ---
title: unzipWith title: unzipWith
tags: array,function,advanced tags: array,advanced
--- ---
Creates an array of elements, ungrouping the elements in an array produced by [zip](#zip) and applying the provided function. Creates an array of elements, ungrouping the elements in an array produced by [zip](#zip) and applying the provided function.

View File

@ -1,6 +1,6 @@
--- ---
title: zipWith title: zipWith
tags: array,function,advanced tags: array,advanced
--- ---
Creates an array of elements, grouped based on the position in the original arrays and using function as the last value to specify how grouped values should be combined. Creates an array of elements, grouped based on the position in the original arrays and using function as the last value to specify how grouped values should be combined.