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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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