Skip to content

Commit 21c1695

Browse files
committed
Update consolidated snippets
1 parent f0c6386 commit 21c1695

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

public/consolidated/all_snippets.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,25 @@
677677
"utility"
678678
],
679679
"author": "loxt-nixo"
680+
},
681+
{
682+
"title": "Zip Arrays",
683+
"description": "Combines two arrays by pairing corresponding elements from each array.",
684+
"code": [
685+
"const zip = (arr1, arr2) => arr1.map((value, index) => [value, arr2[index]]);",
686+
"",
687+
"// Usage:",
688+
"const arr1 = ['a', 'b', 'c'];",
689+
"const arr2 = [1, 2, 3];",
690+
"console.log(zip(arr1, arr2)); // Output: [['a', 1], ['b', 2], ['c', 3]]"
691+
],
692+
"tags": [
693+
"javascript",
694+
"array",
695+
"utility",
696+
"map"
697+
],
698+
"author": "Swaraj-Singh-30"
680699
}
681700
]
682701
},

0 commit comments

Comments
 (0)