js 判断变量是否为数字 isNaN() // 不好使因为null 空格会被识别为0 typeof value === 'number' && !isNaN(value) // 好使非常好使,绝对是数字!!!! 有什么不同见解可以在评论区共同讨论