javascript - Do something if Array element starts with a certain letter -


this question has answer here:

(or not start letter) consider array:

myarray = ['m1','m2','a1'] 

and:

if ( myarray[1] !== *start m* ) { // }; 

is there selector can use?

thanks in advance.

if ( myarray[1].indexof('m') != 0) 

code within if block execute if string not start 'm'


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -