Devlog: A Sip of CoffeeScript

Completed the CoffeeScript course on CodeSchool.

I love these list comprehensions… I don’t think I will be writing straight JS for a while.

1
2
3
4
5
6
7
8
9
10
# Eat lunch.
eat food for food in ['toast', 'cheese', 'wine']

# Fine five course dining.
courses = ['greens', 'caviar', 'truffles', 'roast', 'cake']
menu i + 1, dish for dish, i in courses

# Health conscious meal.
foods = ['broccoli', 'spinach', 'chocolate']
eat food for food in foods when food isnt 'chocolate'

Comments