4.How does a function work?


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


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


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:


thanks guys :smile: @ghughes13 @benjnev