Day 16: Exceptions - String to Integer

  • + 0 comments

    its a hack but works for javascript

    S = parseInt(S);
        try {
            new Array(S);
            console.log(S);
        } catch(err) {
            console.log('Bad String');
        }