We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
A bit ridiculous that with Javascript we are not allowed to use if(isNaN(S) so we have to come up with a hacky code to use some method that will throw errors when passing NaN as param.
Thought these 30 days of code were supposed to teach people how to program, using the concepts of try/catch/finally and not to write hacky code just to make something work. If this is not ideal for this task, simply remove Javascript as an option for Day 16.
Cookie support is required to access HackerRank
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 →
A bit ridiculous that with Javascript we are not allowed to use
if(isNaN(S)
so we have to come up with a hacky code to use some method that will throw errors when passing NaN as param.Thought these 30 days of code were supposed to teach people how to program, using the concepts of try/catch/finally and not to write hacky code just to make something work. If this is not ideal for this task, simply remove Javascript as an option for Day 16.