Skip to main content

Timeline for answer to Using throw in a Javascript expression by KooiInc

Current License: CC BY-SA 4.0

Post Revisions

13 events
when toggle format what by license comment
Dec 23, 2023 at 9:40 history edited KooiInc CC BY-SA 4.0
deleted 2 characters in body
May 27, 2023 at 12:03 history edited KooiInc CC BY-SA 4.0
added 535 characters in body
Jan 3, 2023 at 11:05 history edited KooiInc CC BY-SA 4.0
added 2 characters in body
Nov 9, 2020 at 13:42 history edited KooiInc CC BY-SA 4.0
added 417 characters in body
Jun 5, 2018 at 23:18 history edited Marty Neal CC BY-SA 4.0
Needed missing curly braces
Nov 22, 2017 at 17:58 comment added Lee Whitney III @Alec you're right, I love how it looks super clean. My only reservation to this answer in general is people reading the code will have no idea what's happening, it becomes another bit of black box magic. beginners could even come away thinking that's how throw works in js. Some day they'll try it themselves, and waste lots of time unraveling where they learned it from and why it no longer works.
Nov 21, 2017 at 7:54 history edited KooiInc CC BY-SA 3.0
added 135 characters in body
Nov 20, 2017 at 22:02 comment added alecbz IIFEs aren't too uncommon in Javascript. I think this also becomes a little nicer-looking with arrow functions: var setting = process.env.SETTING || (() => {throw "please set $SETTING";})()
Mar 5, 2012 at 23:06 vote accept Andres Riofrio
Nov 27, 2013 at 0:26
Mar 3, 2012 at 10:51 history edited KooiInc CC BY-SA 3.0
added 264 characters in body
Mar 3, 2012 at 9:49 history edited KooiInc CC BY-SA 3.0
edited body
Mar 3, 2012 at 9:43 comment added casablanca +1 for an interesting solution, even though it seems a bit overkill.
Mar 3, 2012 at 9:38 history answered KooiInc CC BY-SA 3.0