From c2fdfac6cefcbb788a34ca147860cff566722930 Mon Sep 17 00:00:00 2001 From: Isabelle Viktoria Maciohsek Date: Sun, 18 Oct 2020 14:58:09 +0300 Subject: [PATCH] Re-tag array snippets --- snippets/CSVToJSON.md | 4 ++-- snippets/addWeekDays.md | 2 +- snippets/arithmeticProgression.md | 2 +- snippets/averageBy.md | 2 +- snippets/bifurcateBy.md | 2 +- snippets/capitalize.md | 2 +- snippets/countWeekDaysBetween.md | 2 +- snippets/decapitalize.md | 4 ++-- snippets/differenceBy.md | 4 ++-- snippets/digitize.md | 2 +- snippets/fibonacci.md | 2 +- snippets/filterNonUniqueBy.md | 2 +- snippets/getSiblings.md | 2 +- snippets/head.md | 2 +- snippets/intersection.md | 2 +- snippets/intersectionBy.md | 4 ++-- snippets/intersectionWith.md | 2 +- snippets/isPrimitive.md | 2 +- snippets/juxt.md | 2 +- snippets/mapString.md | 2 +- snippets/maxBy.md | 2 +- snippets/midpoint.md | 2 +- snippets/minBy.md | 2 +- snippets/normalizeLineEndings.md | 2 +- snippets/omit.md | 2 +- snippets/omitBy.md | 2 +- snippets/partitionBy.md | 2 +- snippets/pick.md | 2 +- snippets/pickBy.md | 2 +- snippets/primes.md | 2 +- snippets/pullBy.md | 2 +- snippets/readFileLines.md | 2 +- snippets/reverseString.md | 2 +- snippets/sortedIndexBy.md | 2 +- snippets/sortedLastIndexBy.md | 2 +- snippets/sumBy.md | 4 ++-- snippets/symmetricDifferenceBy.md | 2 +- snippets/symmetricDifferenceWith.md | 2 +- snippets/transform.md | 2 +- snippets/unionBy.md | 2 +- snippets/uniqueElementsBy.md | 2 +- snippets/uniqueElementsByRight.md | 2 +- snippets/weightedAverage.md | 2 +- 43 files changed, 48 insertions(+), 48 deletions(-) diff --git a/snippets/CSVToJSON.md b/snippets/CSVToJSON.md index f32367a14..4c1c30bf0 100644 --- a/snippets/CSVToJSON.md +++ b/snippets/CSVToJSON.md @@ -1,6 +1,6 @@ --- title: CSVToJSON -tags: string,array,object,advanced +tags: string,object,advanced --- Converts a comma-separated values (CSV) string to a 2D array of objects. @@ -27,4 +27,4 @@ const CSVToJSON = (data, delimiter = ',') => { ```js CSVToJSON('col1,col2\na,b\nc,d'); // [{'col1': 'a', 'col2': 'b'}, {'col1': 'c', 'col2': 'd'}]; CSVToJSON('col1;col2\na;b\nc;d', ';'); // [{'col1': 'a', 'col2': 'b'}, {'col1': 'c', 'col2': 'd'}]; -``` \ No newline at end of file +``` diff --git a/snippets/addWeekDays.md b/snippets/addWeekDays.md index e0321b306..6bd9c34ab 100644 --- a/snippets/addWeekDays.md +++ b/snippets/addWeekDays.md @@ -1,6 +1,6 @@ --- title: addWeekDays -tags: date,array,intermediate +tags: date,intermediate --- Returns a date after adding given number of business days. diff --git a/snippets/arithmeticProgression.md b/snippets/arithmeticProgression.md index 688a67a1a..c7996a735 100644 --- a/snippets/arithmeticProgression.md +++ b/snippets/arithmeticProgression.md @@ -1,6 +1,6 @@ --- title: arithmeticProgression -tags: math,array,beginner +tags: math,beginner --- Returns an array of numbers in the arithmetic progression starting with the given positive integer and up to the specified limit. diff --git a/snippets/averageBy.md b/snippets/averageBy.md index b0cc18a6b..e35e71701 100644 --- a/snippets/averageBy.md +++ b/snippets/averageBy.md @@ -1,6 +1,6 @@ --- title: averageBy -tags: math,array,function,intermediate +tags: math,array,intermediate --- Returns the average of an array, after mapping each element to a value using the provided function. diff --git a/snippets/bifurcateBy.md b/snippets/bifurcateBy.md index 72de2a788..57f985e02 100644 --- a/snippets/bifurcateBy.md +++ b/snippets/bifurcateBy.md @@ -1,6 +1,6 @@ --- title: bifurcateBy -tags: array,function,intermediate +tags: array,intermediate --- Splits values into two groups according to a predicate function, which specifies which group an element in the input collection belongs to. If the predicate function returns a truthy value, the collection element belongs to the first group; otherwise, it belongs to the second group. diff --git a/snippets/capitalize.md b/snippets/capitalize.md index 14454e1d9..33363b888 100644 --- a/snippets/capitalize.md +++ b/snippets/capitalize.md @@ -1,6 +1,6 @@ --- title: capitalize -tags: string,array,intermediate +tags: string,intermediate --- Capitalizes the first letter of a string. diff --git a/snippets/countWeekDaysBetween.md b/snippets/countWeekDaysBetween.md index 5bdb770d3..54a20f8b5 100644 --- a/snippets/countWeekDaysBetween.md +++ b/snippets/countWeekDaysBetween.md @@ -1,6 +1,6 @@ --- title: countWeekDaysBetween -tags: date,array,intermediate +tags: date,intermediate --- Returns the weekday count between two dates. diff --git a/snippets/decapitalize.md b/snippets/decapitalize.md index 146e83df5..8fa96aa81 100644 --- a/snippets/decapitalize.md +++ b/snippets/decapitalize.md @@ -1,6 +1,6 @@ --- title: decapitalize -tags: string,array,intermediate +tags: string,intermediate --- Decapitalizes the first letter of a string. @@ -16,4 +16,4 @@ const decapitalize = ([first, ...rest], upperRest = false) => ```js decapitalize('FooBar'); // 'fooBar' decapitalize('FooBar', true); // 'fOOBAR' -``` \ No newline at end of file +``` diff --git a/snippets/differenceBy.md b/snippets/differenceBy.md index bf5d3da01..baade057b 100644 --- a/snippets/differenceBy.md +++ b/snippets/differenceBy.md @@ -1,6 +1,6 @@ --- title: differenceBy -tags: array,function,intermediate +tags: array,intermediate --- Returns the difference between two arrays, after applying the provided function to each array element of both. @@ -17,4 +17,4 @@ const differenceBy = (a, b, fn) => { ```js differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); // [1] differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x); // [2] -``` \ No newline at end of file +``` diff --git a/snippets/digitize.md b/snippets/digitize.md index 4f3b9f810..6206bd1ae 100644 --- a/snippets/digitize.md +++ b/snippets/digitize.md @@ -1,6 +1,6 @@ --- title: digitize -tags: math,array,beginner +tags: math,beginner --- Converts a number to an array of digits, removing its sign if necessary. diff --git a/snippets/fibonacci.md b/snippets/fibonacci.md index 2344a5c32..332a36d66 100644 --- a/snippets/fibonacci.md +++ b/snippets/fibonacci.md @@ -1,6 +1,6 @@ --- title: fibonacci -tags: math,array,beginner +tags: math,beginner --- Generates an array, containing the Fibonacci sequence, up until the nth term. diff --git a/snippets/filterNonUniqueBy.md b/snippets/filterNonUniqueBy.md index dd2555767..020527d31 100644 --- a/snippets/filterNonUniqueBy.md +++ b/snippets/filterNonUniqueBy.md @@ -1,6 +1,6 @@ --- title: filterNonUniqueBy -tags: array,function,intermediate +tags: array,intermediate --- Filters out the non-unique values in an array, based on a provided comparator function. diff --git a/snippets/getSiblings.md b/snippets/getSiblings.md index 3bb7daabd..ae2230433 100644 --- a/snippets/getSiblings.md +++ b/snippets/getSiblings.md @@ -1,6 +1,6 @@ --- title: getSiblings -tags: browser,array,intermediate +tags: browser,intermediate --- Returns an array containing all the siblings of the given element. diff --git a/snippets/head.md b/snippets/head.md index c6f13bef0..244afd216 100644 --- a/snippets/head.md +++ b/snippets/head.md @@ -3,7 +3,7 @@ title: head tags: array,beginner --- -Returns the head of a list. +Returns the head of an array. - Check if `arr` is truthy and has a `length` property, use `arr[0]` if possible to return the first element, otherwise return `undefined`. diff --git a/snippets/intersection.md b/snippets/intersection.md index 2b523a279..8c3b052af 100644 --- a/snippets/intersection.md +++ b/snippets/intersection.md @@ -3,7 +3,7 @@ title: intersection tags: array,math,intermediate --- -Returns a list of elements that exist in both arrays. +Returns the elements that exist in both arrays. - Create a `Set` from `b`, then use `Array.prototype.filter()` on `a` to only keep values contained in `b`. diff --git a/snippets/intersectionBy.md b/snippets/intersectionBy.md index 6774516ce..2eb893fb3 100644 --- a/snippets/intersectionBy.md +++ b/snippets/intersectionBy.md @@ -1,9 +1,9 @@ --- title: intersectionBy -tags: array,function,intermediate +tags: array,intermediate --- -Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both. +Returns the elements that exist in both arrays, after applying the provided function to each array element of both. - Create a `Set` by applying `fn` to all elements in `b`, then use `Array.prototype.filter()` on `a` to only keep elements, which produce values contained in `b` when `fn` is applied to them. diff --git a/snippets/intersectionWith.md b/snippets/intersectionWith.md index 858614833..46a58d8bf 100644 --- a/snippets/intersectionWith.md +++ b/snippets/intersectionWith.md @@ -3,7 +3,7 @@ title: intersectionWith tags: array,function,intermediate --- -Returns a list of elements that exist in both arrays, using a provided comparator function. +Returns the elements that exist in both arrays, using a provided comparator function. - Use `Array.prototype.filter()` and `Array.prototype.findIndex()` in combination with the provided comparator to determine intersecting values. diff --git a/snippets/isPrimitive.md b/snippets/isPrimitive.md index f5f41e6d3..60d08fd7f 100644 --- a/snippets/isPrimitive.md +++ b/snippets/isPrimitive.md @@ -1,6 +1,6 @@ --- title: isPrimitive -tags: type,function,array,string,intermediate +tags: type,intermediate --- Returns a boolean determining if the passed value is primitive or not. diff --git a/snippets/juxt.md b/snippets/juxt.md index 90fc5ed1f..a9e008bf3 100644 --- a/snippets/juxt.md +++ b/snippets/juxt.md @@ -1,6 +1,6 @@ --- title: juxt -tags: array,function,advanced +tags: function,advanced --- Takes several functions as argument and returns a function that is the juxtaposition of those functions. diff --git a/snippets/mapString.md b/snippets/mapString.md index aaea0d14f..6b8949dcc 100644 --- a/snippets/mapString.md +++ b/snippets/mapString.md @@ -1,6 +1,6 @@ --- title: mapString -tags: string,array,function,beginner +tags: string,intermediate --- Creates a new string with the results of calling a provided function on every character in the calling string. diff --git a/snippets/maxBy.md b/snippets/maxBy.md index b83caf284..4f24a1437 100644 --- a/snippets/maxBy.md +++ b/snippets/maxBy.md @@ -1,6 +1,6 @@ --- title: maxBy -tags: math,array,function,beginner +tags: math,array,beginner --- Returns the maximum value of an array, after mapping each element to a value using the provided function. diff --git a/snippets/midpoint.md b/snippets/midpoint.md index 524645780..1a0255ab5 100644 --- a/snippets/midpoint.md +++ b/snippets/midpoint.md @@ -1,6 +1,6 @@ --- title: midpoint -tags: math,array,beginner +tags: math,beginner --- Calculates the midpoint between two pairs of (x,y) points. diff --git a/snippets/minBy.md b/snippets/minBy.md index 9b9227a0a..31e0ba3b5 100644 --- a/snippets/minBy.md +++ b/snippets/minBy.md @@ -1,6 +1,6 @@ --- title: minBy -tags: math,array,function,beginner +tags: math,array,beginner --- Returns the minimum value of an array, after mapping each element to a value using the provided function. diff --git a/snippets/normalizeLineEndings.md b/snippets/normalizeLineEndings.md index 61a60b2c5..49fddfb60 100644 --- a/snippets/normalizeLineEndings.md +++ b/snippets/normalizeLineEndings.md @@ -1,6 +1,6 @@ --- title: normalizeLineEndings -tags: array,intermediate +tags: string,intermediate --- Normalizes line endings in a string. diff --git a/snippets/omit.md b/snippets/omit.md index 6a49d9812..11c626e71 100644 --- a/snippets/omit.md +++ b/snippets/omit.md @@ -1,6 +1,6 @@ --- title: omit -tags: object,array,intermediate +tags: object,intermediate --- Omits the key-value pairs corresponding to the given keys from an object. diff --git a/snippets/omitBy.md b/snippets/omitBy.md index 8e5c1b492..14a21e230 100644 --- a/snippets/omitBy.md +++ b/snippets/omitBy.md @@ -1,6 +1,6 @@ --- title: omitBy -tags: object,array,function,intermediate +tags: object,intermediate --- Creates an object composed of the properties the given function returns falsy for. The function is invoked with two arguments: (value, key). diff --git a/snippets/partitionBy.md b/snippets/partitionBy.md index eb99ba11e..39f5e2aad 100644 --- a/snippets/partitionBy.md +++ b/snippets/partitionBy.md @@ -1,6 +1,6 @@ --- title: partitionBy -tags: array,object,function,advanced +tags: array,object,advanced --- Applies `fn` to each value in `arr`, splitting it each time `fn` returns a new value. diff --git a/snippets/pick.md b/snippets/pick.md index c1569daa3..a6a26ca1c 100644 --- a/snippets/pick.md +++ b/snippets/pick.md @@ -1,6 +1,6 @@ --- title: pick -tags: object,array,intermediate +tags: object,intermediate --- Picks the key-value pairs corresponding to the given keys from an object. diff --git a/snippets/pickBy.md b/snippets/pickBy.md index 7464af54e..b609b504b 100644 --- a/snippets/pickBy.md +++ b/snippets/pickBy.md @@ -1,6 +1,6 @@ --- title: pickBy -tags: object,array,function,intermediate +tags: object,intermediate --- Creates an object composed of the properties the given function returns truthy for. The function is invoked with two arguments: (value, key). diff --git a/snippets/primes.md b/snippets/primes.md index db0d7d78f..946e4b022 100644 --- a/snippets/primes.md +++ b/snippets/primes.md @@ -1,6 +1,6 @@ --- title: primes -tags: math,array,intermediate +tags: math,intermediate --- Generates primes up to a given number, using the Sieve of Eratosthenes. diff --git a/snippets/pullBy.md b/snippets/pullBy.md index 3685ecfc4..fb5ae4212 100644 --- a/snippets/pullBy.md +++ b/snippets/pullBy.md @@ -1,6 +1,6 @@ --- title: pullBy -tags: array,function,advanced +tags: array,advanced --- Mutates the original array to filter out the values specified, based on a given iterator function. diff --git a/snippets/readFileLines.md b/snippets/readFileLines.md index 6bd157257..f6f13d809 100644 --- a/snippets/readFileLines.md +++ b/snippets/readFileLines.md @@ -1,6 +1,6 @@ --- title: readFileLines -tags: node,array,string,beginner +tags: node,beginner --- Returns an array of lines from the specified file. diff --git a/snippets/reverseString.md b/snippets/reverseString.md index 4f6eb21fb..79fe59c9c 100644 --- a/snippets/reverseString.md +++ b/snippets/reverseString.md @@ -1,6 +1,6 @@ --- title: reverseString -tags: string,array,beginner +tags: string,beginner --- Reverses a string. diff --git a/snippets/sortedIndexBy.md b/snippets/sortedIndexBy.md index 4c0ca11f8..19c4d02dc 100644 --- a/snippets/sortedIndexBy.md +++ b/snippets/sortedIndexBy.md @@ -1,6 +1,6 @@ --- title: sortedIndexBy -tags: array,math,function,intermediate +tags: array,math,intermediate --- Returns the lowest index at which value should be inserted into array in order to maintain its sort order, based on a provided iterator function. diff --git a/snippets/sortedLastIndexBy.md b/snippets/sortedLastIndexBy.md index d72bdf137..2f531b928 100644 --- a/snippets/sortedLastIndexBy.md +++ b/snippets/sortedLastIndexBy.md @@ -1,6 +1,6 @@ --- title: sortedLastIndexBy -tags: array,math,function,intermediate +tags: array,math,intermediate --- Returns the highest index at which value should be inserted into array in order to maintain its sort order, based on a provided iterator function. diff --git a/snippets/sumBy.md b/snippets/sumBy.md index f0d4eefc2..90bf0539f 100644 --- a/snippets/sumBy.md +++ b/snippets/sumBy.md @@ -1,6 +1,6 @@ --- title: sumBy -tags: math,array,function,intermediate +tags: math,array,intermediate --- Returns the sum of an array, after mapping each element to a value using the provided function. @@ -15,4 +15,4 @@ const sumBy = (arr, fn) => ```js sumBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n); // 20 sumBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'); // 20 -``` \ No newline at end of file +``` diff --git a/snippets/symmetricDifferenceBy.md b/snippets/symmetricDifferenceBy.md index 93778a388..5120eca17 100644 --- a/snippets/symmetricDifferenceBy.md +++ b/snippets/symmetricDifferenceBy.md @@ -1,6 +1,6 @@ --- title: symmetricDifferenceBy -tags: array,function,intermediate +tags: array,intermediate --- Returns the symmetric difference between two arrays, after applying the provided function to each array element of both. diff --git a/snippets/symmetricDifferenceWith.md b/snippets/symmetricDifferenceWith.md index 2ef42c1dc..d4285b87e 100644 --- a/snippets/symmetricDifferenceWith.md +++ b/snippets/symmetricDifferenceWith.md @@ -1,6 +1,6 @@ --- title: symmetricDifferenceWith -tags: array,function,intermediate +tags: array,intermediate --- Returns the symmetric difference between two arrays, using a provided function as a comparator. diff --git a/snippets/transform.md b/snippets/transform.md index 91d0803e0..41df6cf41 100644 --- a/snippets/transform.md +++ b/snippets/transform.md @@ -1,6 +1,6 @@ --- title: transform -tags: object,array,intermediate +tags: object,intermediate --- Applies a function against an accumulator and each key in the object (from left to right). diff --git a/snippets/unionBy.md b/snippets/unionBy.md index 01e36876e..91251fa7a 100644 --- a/snippets/unionBy.md +++ b/snippets/unionBy.md @@ -1,6 +1,6 @@ --- title: unionBy -tags: array,function,intermediate +tags: array,intermediate --- Returns every element that exists in any of the two arrays once, after applying the provided function to each array element of both. diff --git a/snippets/uniqueElementsBy.md b/snippets/uniqueElementsBy.md index d1945db5b..026142597 100644 --- a/snippets/uniqueElementsBy.md +++ b/snippets/uniqueElementsBy.md @@ -1,6 +1,6 @@ --- title: uniqueElementsBy -tags: array,function,intermediate +tags: array,intermediate --- Returns all unique values of an array, based on a provided comparator function. diff --git a/snippets/uniqueElementsByRight.md b/snippets/uniqueElementsByRight.md index 981615e59..7f1994fce 100644 --- a/snippets/uniqueElementsByRight.md +++ b/snippets/uniqueElementsByRight.md @@ -1,6 +1,6 @@ --- title: uniqueElementsByRight -tags: array,function,intermediate +tags: array,intermediate --- Returns all unique values of an array, based on a provided comparator function, starting from the right. diff --git a/snippets/weightedAverage.md b/snippets/weightedAverage.md index 03bdc0816..76d44dd4c 100644 --- a/snippets/weightedAverage.md +++ b/snippets/weightedAverage.md @@ -1,6 +1,6 @@ --- title: weightedAverage -tags: math,array,intermediate +tags: math,intermediate --- Returns the weighted average of two or more numbers.