Created
December 23, 2019 10:59
-
-
Save bharat20185/4da2df0c189c9153b0cfc9a1665ac94d to your computer and use it in GitHub Desktop.
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> | |
variables.heroes = [ | |
{ | |
'name': 'Iron Man', | |
'movies': 11 | |
}, | |
{ | |
'name': 'Captain America', | |
'movies': 7 | |
} | |
]; | |
variables.heroes.each( | |
function(hero, index, array) { | |
writeOutput(hero.name & ' played role in ' & hero.movies & ' movies'); | |
writeOutput('<br />'); | |
} | |
); | |
// Using => function | |
variables.heroes.each((hero, index, array) => { | |
writeOutput(hero.name & ' played role in ' & hero.movies & ' movies'); | |
writeOutput('<br />'); | |
}); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment