Urara-Blog/node_modules/.pnpm-store/v3/files/94/74c109c01406589d119a44f48bc8c887248cc381c7d0df177b47811b5b714c544e60eb6c4682f81899bf8a4faad82923439658f8b6e7d6b827d2d3c2fbb0c1
2022-08-14 01:14:53 +08:00

30 lines
No EOL
456 B
Text

# 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)
# From https://coffeescript.org/#overview