We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1477d60 commit 99d539cCopy full SHA for 99d539c
2634. filter-elements-from-array/index.js
@@ -0,0 +1,9 @@
1
+const filter = (arr, fn) => {
2
+ const temp = []
3
+ for (let i = 0; i < arr.length; i++) {
4
+ if(fn(arr[i], i)) {
5
+ temp.push(arr[i])
6
+ }
7
8
+ return temp
9
+}
0 commit comments