class Person
var Person; Person = (function() { function Person() {} return Person; })();
food = 'toast'
aFood = food
console.log aFood
# 'toast'
foods = ['toast', 'cheese', 'wine']
theFood = foods
console.log theFood
# ['toast', 'cheese', 'wine']
foods = ['toast', 'cheese', 'wine']
first = foods[0]
console.log first
# 'toast'
foods = ['toast', 'cheese', 'wine']
first = foods[0]
console.log first
# 'toast'
foods = ['toast', 'cheese', 'wine']
first = foods
console.log first
# ['toast', 'cheese', 'wine']
foods = ['toast', 'cheese', 'wine']
[first] = foods
console.log first
# 'toast'
foods = ['toast', 'cheese', 'wine']
[first, second, third] = foods
console.log first, second, third
# toast cheese wine
foods = {carb: 'toast', fat: 'cheese', beverage: 'wine'}
carb = foods.carb
console.log carb
# 'toast'
foods = {carb: 'toast', fat: 'cheese', beverage: 'wine'}
carb = foods
console.log carb
# {carb: 'toast', fat: 'cheese', beverage: 'wine'}
foods = {carb: 'toast', fat: 'cheese', beverage: 'wine'}
{carb} = foods
console.log carb
# 'toast'
foods = {carb: 'toast', fat: 'cheese', beverage: 'wine'}
{carb, fat, beverage} = foods
console.log carb, fat, beverage
# 'toast cheese wine'
foods = {carb: 'toast', fat: 'cheese', beverage: ['wine', 'coffee']}
{carb, fat, beverage:[firstBev, lastBev]} = foods
console.log carb, fat, firstBev, lastBev
# 'toast cheese wine coffee'
for(var i = 1; i <= 10; i++) {
log(i);
}
// The same for loop we've had for 40 years
for var i = 1; i <= 10; i++
log i ;
for i = 1 i <= 10 i++
log i
for i = 1 <= 10
log i
for i [1..10]
log i
for i in [1..10]
log i
for i in [1..10]
log i
for(var i = 1; i <= 10; i++) {
log(i);
}
for i in [1..10]
log i
foods = ['toast', 'cheese', 'wine']
for food in foods
eat food
foods = ['toast', 'cheese', 'wine']
for food in foods
eat food
foods = ['toast', 'cheese', 'wine']
eat food for food in foods
foods = ['toast', 'cheese', 'wine']
eat food for food in foods
foods = ['toast', 'cheese', 'wine']
eat food for food in foods
foods = ['toast', 'cheese', 'wine']
eat food for food in foods when food isnt 'wine'
foods = ['toast', 'cheese', 'wine']
eat food for food in foods when food isnt 'wine'
foods = ['toast', 'cheese', 'wine']
aFood = food for food in foods when food isnt 'wine'
# ?
foods = ['toast', 'cheese', 'wine']
aFood = food for food in foods when food isnt 'wine'
# aFood = 'cheese'
foods = ['toast', 'cheese', 'wine']
aFood = (food for food in foods when food isnt 'wine')
# ?
foods = ['toast', 'cheese', 'wine']
aFood = (food for food in foods when food isnt 'wine')
# aFood = ['toast', 'cheese']