KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need multiple cases in switch statement in JavaScript, Something like: switch (varName) { case "afshin", "saeed", "larry": alert('Hey'); break; default: alert('Default case'); break; } How can I do that? If there's no way to do something like that in JavaScript, I want to know an alternative solution that also follows the DRY concept .
Tags (comma-separated)
Save Edits
Cancel