Day 16: Exceptions - String to Integer

  • + 13 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.