Then CoffeeScript is a giantrobot made of other robots
I guess I’m trying to say thatCoffeeScript might not be aterrible idea.
CoffeeScript does borrowfrom some of the bestlanguages.The Python and Rubyinﬂuences are glaringly obvious.
Let’s walk through a simpleCoffeeScript application.https://github.com/feihong/coffeescript-talk
Multiline comments###Implement a shuffle() function that randomlyrearranges the elements in a given array.Also demo its usage and effect.###
Multiline commentnotes• Multiline comments appear as-is in thecompiled .js ﬁle, using the /* */ commentsyntax.
Main functionmain = ->array = (c.toUpperCase() for c in abcdefg)display array$(document.body).append <hr>for i in [1..6]shuffle arraydisplay array
Main function notes• Whitespace delimits blocks• Deﬁne function using -> operator• Array expression uses parentheses• Parentheses not required for functioninvocation• Ranges speciﬁed using [a..b]• No colon at end of looping statement