CoffeeScript
-
Upload
jeroen-rosenberg -
Category
Technology
-
view
320 -
download
7
description
Transcript of CoffeeScript
"It's just JavaScript"
coated with syntax sugar
CoffeeScript attempts to expose those 'good parts'
Didyounotice?
#nuffsaidit's quite thin
But its core is gooooood
CoffeeScript attempts to expose those 'good parts'
CoffeeScript exposes those
'good parts'
CoffeeScript attempts to expose those 'good parts'
RubyPythonHaskell
# prototypingString::downCase = -> @toLowerCase()
# functions, chained comparisonisMyAge = (age) ->
24 < age < 26
# splat arguments, pattern matchingunCapitalize = (words...) ->
(words.map ([firstChar, rest...]) -> firstChar.downCase() + rest.join '').join ''
# destructuring assignment, function bindingMe = ([surname, middlenames..., lastname] ) -> # string interpolation
@name = "#{surname} #{lastname}"
# everything is an expression@age = if isMyAge(x = 25) then x else '?' @twitter = unCapitalize('@', surname, lastname)
# use jQuery (or any JavaScript library), multi line Strings$('#welcome').bind 'click' (event) => alert "Hello,
I'm #{@name}!"# there's no var!!me = Me("Jeroen Matthijs Rosenberg".split ' ')
#nuffsaid
word.spread! for people in continents[..] when people isnt aware