Created
September 8, 2019 05:00
-
-
Save trycf/04cbafa3fbf5c132f13944d01195e971 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> | |
listData = ["apples","oranges","rocks","jets","developers"]; | |
format = ( formatter ) => ( data ) => data.map( formatter ); | |
// Wraps each item in <li></li> | |
formatAsList = format( (row)=>"<li>#row#</li>" ); | |
// Displays each item as a button | |
formatAsButtons = format( (row)=>'<button>#row#</button>' ); | |
writeOutput( | |
formatAsList( listData ).toList(" ") | |
); | |
writeOutput( | |
formatAsButtons( listData ).toList(" ") | |
); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment