diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2015-06-24 15:51:29 +0300 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2015-06-24 15:51:29 +0300 |
commit | 0b1da3cf8671f35de7562cfa7235d87097e6f81d (patch) | |
tree | 6d70cc299fd3bed94c856ca284e45c8ed2940ed6 /tests/test.coffee | |
parent | 435dab1dd413f57bd6744ae60df0222afb5af4c8 (diff) |
Add application/vnd.coffeescript
http://www.iana.org/assignments/media-types/application/vnd.coffeescript
Diffstat (limited to 'tests/test.coffee')
-rw-r--r-- | tests/test.coffee | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test.coffee b/tests/test.coffee new file mode 100644 index 0000000..0db65dd --- /dev/null +++ b/tests/test.coffee @@ -0,0 +1,28 @@ +# Assignment: +number = 42 +opposite = true + +# Conditions: +number = -42 if opposite + +# Functions: +square = (x) -> x * x + +# Arrays: +list = [1, 2, 3, 4, 5] + +# Objects: +math = + root: Math.sqrt + square: square + cube: (x) -> x * square x + +# Splats: +race = (winner, runners...) -> + print winner, runners + +# Existence: +alert "I knew it!" if elvis? + +# Array comprehensions: +cubes = (math.cube num for num in list) |