Created
November 10, 2013 00:22
-
-
Save uberscientist/7391978 to your computer and use it in GitHub Desktop.
map array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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