Skip to content

Commit 22d53f0

Browse files
authored
Update index.js
1 parent 672acef commit 22d53f0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ function get_all_indexes(arr, val) {
9393
return indexes;
9494
}
9595

96+
function search_in_array(query,array) {
97+
return array.filter(item => item.search(query) !== -1)
98+
}
99+
96100
export {
97101
head,
98102
tail,
@@ -103,4 +107,5 @@ export {
103107
array_frequency,
104108
object_to_array,
105109
get_all_indexes,
110+
search_in_array,
106111
};

0 commit comments

Comments
 (0)