wdi-hk-sep-2014 / notes

Notes for WDI course
3 stars 5 forks source link

Switch in CoffeeScript is object or not? #7

Open harryworld opened 10 years ago

harryworld commented 10 years ago

We had a debate on whether switch in CoffeeScript is an object or not?

harryworld commented 10 years ago

I think in JavaScript, switch is defined as statement (Control Flow), more like a syntax.

The switch statement evaluates an expression, matching the expression's value to a case clause, and executes statements associated with that case.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Statements