Created
January 14, 2016 02:38
-
-
Save jafow/72fb30c47aaf497a31a7 to your computer and use it in GitHub Desktop.
matchElements
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
/**Some of the image URLs in the datastore are broken. This ```matchElements``` function returns a new array of valid URLs that match the ``@param {Regex} match` object. | |
*/ | |
const matchElements = (arr) => | |
function (match) { | |
return arr.filter((str) => match.test(str)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment