You are viewing a single comment's thread. Return to all comments →
that is a nonsense. why doesn't work the similar code? ` function main() { const S: string = readLine(); const N = Number(S);
try { if (isNaN(N)) { throw new Error("Bad String") } else { console.log(N) } } catch(error) { console.log(error.message); }
} `
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Day 16: Exceptions - String to Integer
You are viewing a single comment's thread. Return to all comments →
that is a nonsense. why doesn't work the similar code? ` function main() { const S: string = readLine(); const N = Number(S);
} `