Skip to content

Instantly share code, notes, and snippets.

@uberscientist
Created November 10, 2013 00:22
Show Gist options
  • Save uberscientist/7391978 to your computer and use it in GitHub Desktop.
Save uberscientist/7391978 to your computer and use it in GitHub Desktop.
map array
var files = ['midi01', 'nomatch', 'gerrhihoos', 'midi29s', 'sadfmidi', '3333s'];
var patt = new RegExp('midi', 'i');
var matches = files.map(function(file) {
if(patt.exec(file)) {
return file;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment