4.How does a function work?


#1

I've been trying this for ages and still can't get it right. Somebody please help. :sob:


#2

EDIT: I was wrong, but still

var foodDemand = function(food)

Good to space things out rather than having it as

var foodDemand=function(food)

@ghughes13 is correct I believe


#3

You're just calling it wrong. No big.

Change the last line to foodDemand("pizza")

@benjnev's right too though. Spacing's essential to having readable code when you start writing a lot of it.:raised_hands:


#5

thanks guys :smile: @ghughes13 @benjnev