摘要: Math.ceil(1.2) //2 向上取整 Math.floor(1.3) //2 向下取整 Math.round(4.3)//4 四舍五入 Math.random() 0-10随机数 包含0但不包含10 生成0-10随机数 Math.floor(Math.random()*(10+1)) 生成 阅读全文
posted @ 2024-03-07 18:07 howhy 阅读(13) 评论(0) 推荐(0) 编辑
摘要: let age=12 console.log(false && age++) //逻辑与前一个为假就中断后面不执行 两个都为真时结果为后一个值 console.log(age) //12 console.log(true|| age++)// 逻辑或前一个为真就中断后面不执行 前一个值为真是 结果为 阅读全文
posted @ 2024-03-07 16:19 howhy 阅读(14) 评论(0) 推荐(0) 编辑