KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Here is what I want to do: var setting = process.env.SETTING || throw new Error("please set the SETTING environmental variable"); ^^^^^ But the interpreter complains about "Syntax Error: Unexpected token throw". Is there any way to throw an exception in the same line that we compare whether a value is falsey or not?
Tags (comma-separated)
Save Edits
Cancel