You are viewing a single comment's thread. Return to all comments →
Thanks! I've found an easier way to throw an exception in javascript:
try { var answer = isNaN(+ input) ? null.throw : + input; } catch (e) { answer = 'Bad String'; } process.stdout.write(answer.toString());
Seems like cookies are disabled on this browser, please enable them to open this website
Day 16: Exceptions - String to Integer
You are viewing a single comment's thread. Return to all comments →
Thanks! I've found an easier way to throw an exception in javascript: