Created
April 1, 2022 16:50
-
-
Save trycf/df87e20498aa6b02d7986dd7c8c7a729 to your computer and use it in GitHub Desktop.
TryCF Gist
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
<cfscript> | |
myArray = ['foo','foo','foo','quix','bar']; | |
createFilter = ( term ) => ( el ) => el == term; | |
barFinder = createFilter( 'bar' ); | |
filteredArray = myArray.filter(barFinder); | |
writeDump(filteredArray); | |
quixFinder = createFilter( 'quix' ); | |
filteredArray = myArray.filter(quixFinder); | |
writeDump(filteredArray); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment