Skip to content

Commit 452f2a1

Browse files
Update javascript.json
1 parent 51de911 commit 452f2a1

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

public/consolidated/javascript.json

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,6 @@
1515
"contributors": [],
1616
"code": "const flattenArray = (arr) => arr.flat(Infinity);\n\n// Usage:\nconst nestedArray = [1, [2, [3, [4]]]];\nconsole.log(flattenArray(nestedArray)); // Output: [1, 2, 3, 4]\n"
1717
},
18-
{
19-
"title": "Partition Array",
20-
"description": "Splits an array into two arrays based on a callback function.",
21-
"author": "Swaraj-Singh-30",
22-
"tags": [
23-
"javascript",
24-
"array",
25-
"partition",
26-
"reduce",
27-
"utility"
28-
],
29-
"contributors": [],
30-
"code": "const partition = (arr, callback) =>\n arr.reduce(\n ([pass, fail], elem) => (callback(elem) ? [[...pass, elem], fail] : [pass, [...fail, elem]]),\n [[], []]\n );\n\n// Usage:\nconst numbers = [1, 2, 3, 4, 5, 6];\nconst isEven = (n) => n % 2 === 0;\nconsole.log(partition(numbers, isEven)); // Output: [[2, 4, 6], [1, 3, 5]]\n"
31-
},
3218
{
3319
"title": "Remove Duplicates",
3420
"description": "Removes duplicate values from an array.",
@@ -1019,4 +1005,4 @@
10191005
}
10201006
]
10211007
}
1022-
]
1008+
]

0 commit comments

Comments
 (0)