会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
魏无羡的小古板
博客园
首页
新随笔
联系
管理
订阅
2021年4月12日
JavaScript判断值是否为整数
摘要: 任何整数都会被1整除,即余数是0。利用这个规则来判断是否是整数。 function isInteger(obj) { return obj % 1 0 } isInteger(''); //true isInteger('3'); //true isInteger(true); //true isI
阅读全文
posted @ 2021-04-12 17:31 魏无羡的小古板
阅读(428)
评论(0)
推荐(0)
编辑