EDIT
This question seems to be about Jade.
But the answer is still yes :).
But it is called case :
From the docs
case friends when 0 p you have no friends when 1 p you have a friend default p you have
Javascript has a switch statement.
switch(variable){ case 1: // do something break; case 2: // do something else break; // and so forth default: // do something if nothing break; }
Being that Express.js works in Node.js, which is just JavaScript - yes. Express has a switch because JavaScript has a switch . (Even coffeescript has a switch that "compiles" before the JavaScript switch .)
MDN Link: switch statement
Your syntax seems to be flawed - what are the "-" characters? You also lack : from the end of each case , and you are not break ing after each case, which means that the code for ALL cases will ALWAYS work regardless of the condition.
tkone
source share