Skip to content

Commit

Permalink
Update consolidated snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 31, 2024
1 parent f0c6386 commit 21c1695
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions public/consolidated/all_snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,25 @@
"utility"
],
"author": "loxt-nixo"
},
{
"title": "Zip Arrays",
"description": "Combines two arrays by pairing corresponding elements from each array.",
"code": [
"const zip = (arr1, arr2) => arr1.map((value, index) => [value, arr2[index]]);",
"",
"// Usage:",
"const arr1 = ['a', 'b', 'c'];",
"const arr2 = [1, 2, 3];",
"console.log(zip(arr1, arr2)); // Output: [['a', 1], ['b', 2], ['c', 3]]"
],
"tags": [
"javascript",
"array",
"utility",
"map"
],
"author": "Swaraj-Singh-30"
}
]
},
Expand Down

0 comments on commit 21c1695

Please sign in to comment.