From dec6c2802917ecf2961815d03fe2596f2cc7eef3 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 4 Feb 2020 22:45:31 +0200 Subject: [PATCH] Update unzip.md --- snippets/unzip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/unzip.md b/snippets/unzip.md index 5335959f8..4fcf0e09b 100644 --- a/snippets/unzip.md +++ b/snippets/unzip.md @@ -3,7 +3,7 @@ title: unzip tags: array,intermediate --- -Creates an array of arrays, ungrouping the elements in an array produced by [zip](#zip). +Creates an array of arrays, ungrouping the elements in an array produced by [zip](/js/s/zip). Use `Math.max.apply()` to get the longest subarray in the array, `Array.prototype.map()` to make each element an array. Use `Array.prototype.reduce()` and `Array.prototype.forEach()` to map grouped values to individual arrays. @@ -21,4 +21,4 @@ const unzip = arr => ```js unzip([['a', 1, true], ['b', 2, false]]); // [['a', 'b'], [1, 2], [true, false]] unzip([['a', 1, true], ['b', 2]]); // [['a', 'b'], [1, 2], [true]] -``` \ No newline at end of file +```