文章浏览阅读270次,点赞8次,收藏9次。var num3 = 177.234 console.log("num3.toFixed() 为 "+num3.toFixed()) // 输出:177 console.log("num3.toFixed(2) 为 "+num3.toFixed(2)) // 输出:177.23 console.log("num3.toFixed(6) 为 "+num3.toFixed(6)) // 输出:177.234000。const和let都有个暂时性死区的概念,暂时性死区,就是在声明之前,使用变量,会报错。