diff options
author | Todd M. Guerra <toddguerra@gmail.com> | 2015-10-09 11:14:29 -0400 |
---|---|---|
committer | Todd M. Guerra <toddguerra@gmail.com> | 2015-10-09 11:14:29 -0400 |
commit | fc3c56ee938dbb7231127465b0e9ab5fa7f2da40 (patch) | |
tree | 444181fbb299567b566a038ab4241e31ca519a97 /coffeescript.html.markdown | |
parent | 6d3f52b7f01409818853de6148abf1d8fe57fab0 (diff) | |
parent | dcd9093d6467166a2946008c55f5e0582a15e20c (diff) |
Merge remote-tracking branch 'adambard/master'
Conflicts:
java.html.markdown
Diffstat (limited to 'coffeescript.html.markdown')
-rw-r--r-- | coffeescript.html.markdown | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/coffeescript.html.markdown b/coffeescript.html.markdown index 85a5f81f..f19181ce 100644 --- a/coffeescript.html.markdown +++ b/coffeescript.html.markdown @@ -54,19 +54,19 @@ math = square: square cube: (x) -> x * square x #=> var math = { -# "root": Math.sqrt, -# "square": square, -# "cube": function(x) { return x * square(x); } -#} +# "root": Math.sqrt, +# "square": square, +# "cube": function(x) { return x * square(x); } +# }; # Splats: race = (winner, runners...) -> print winner, runners #=>race = function() { -# var runners, winner; -# winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : []; -# return print(winner, runners); -#}; +# var runners, winner; +# winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : []; +# return print(winner, runners); +# }; # Existence: alert "I knew it!" if elvis? @@ -75,14 +75,14 @@ alert "I knew it!" if elvis? # Array comprehensions: cubes = (math.cube num for num in list) #=>cubes = (function() { -# var _i, _len, _results; -# _results = []; +# var _i, _len, _results; +# _results = []; # for (_i = 0, _len = list.length; _i < _len; _i++) { -# num = list[_i]; -# _results.push(math.cube(num)); -# } -# return _results; -# })(); +# num = list[_i]; +# _results.push(math.cube(num)); +# } +# return _results; +# })(); foods = ['broccoli', 'spinach', 'chocolate'] eat food for food in foods when food isnt 'chocolate' |