Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trycf/df87e20498aa6b02d7986dd7c8c7a729 to your computer and use it in GitHub Desktop.
Save trycf/df87e20498aa6b02d7986dd7c8c7a729 to your computer and use it in GitHub Desktop.
TryCF Gist
<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