how to extract strings in array js

Solutions on MaxInterview for how to extract strings in array js by the best coders in the world

showing results for - "how to extract strings in array js"
Devlin
04 Apr 2018
1function search (array,string) {
2
3    var arr= [];
4
5    for (var i=0; i<array.length; i++) {
6        if (array[i].match(string)){
7
8          arr.push(i)
9
10          return arr;
11        }  
12    }
13      return -1;
14  }
15
16 search(array,'v_')
17