Viven

8小时计划!

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2017年4月20日

摘要: console.log(Math.abs(-5)) 取绝对值 console.log(Math.round(5.1)) 取四舍五入 5.5 为中间值 取5 console.log(Math.ceil(5.1)) 取整数 +1 console.log(Math.floor(5.9)) 取整数 cons 阅读全文
posted @ 2017-04-20 21:04 Viven张 阅读(415) 评论(0) 推荐(0) 编辑

摘要: 在遍历一个对象的时候我们会使用到for in属性。 现有对象和数组如下: 对于数组来说我们可以使用for来遍历 也可以使用for 现在要遍历filght里面的属性,我们可以使用for in 但是不能使用 for来遍历,因为对象没有长度。 那么for 和for in 遍历最大的区别是for in可以遍 阅读全文
posted @ 2017-04-20 10:02 Viven张 阅读(277) 评论(0) 推荐(0) 编辑