摘要: 一、JavaScript中判断为整数的多种方式 方式一、使用取余运算符判断 function isInteger(obj) { return obj%1 0 } 正确: isInteger(4) // true isInteger(4.8) // false 错误: isInteger(4) // 阅读全文
posted @ 2019-03-31 21:10 前端开发-周先生 阅读(242) 评论(0) 推荐(0)