常用取值
//取絕對值
?? ?document.write(Math.abs(-1)+"<br>");
?? ?//向上取整
?? ?document.write(Math.ceil(12.2)+"<br>");
?? ?document.write(Math.ceil(-12.2)+"<br>");
?? ?//向下取整
?? ?document.write(Math.floor(12.8)+"<br>");
?? ?//次冪
?? ?document.write(Math.pow(3,2)+"<br>");
?? ?//隨機數
?? ?document.write(Math.random()+"<br>");
???
轉載于:https://www.cnblogs.com/G-qz/p/10708674.html
總結
- 上一篇: 第四章学习小结
- 下一篇: Vue 组件间通信方法汇总