• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Assignment:
2number   = 42
3opposite = true
4
5# Conditions:
6number = -42 if opposite
7
8# Functions:
9square = (x) -> x * x
10
11# Arrays:
12list = [1, 2, 3, 4, 5]
13
14# Objects:
15math =
16	root:   Math.sqrt
17	square: square
18	cube:   (x) -> x * square x
19
20# Splats:
21race = (winner, runners...) ->
22	print winner, runners
23
24# Existence:
25if true
26	alert "I knew it!"
27
28# Array comprehensions:
29cubes = (math.cube num for num in list)
30