JavaScript solution


  • -2
    S
    /**
     * @param {string} s
     * @return {boolean}
     */
    var isNumber = function(s) {
        s = s.trim();
        return !isNaN(+s) && s !== '';
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.