![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ES6
ES6学习笔记
江湖与天涯
逆流而上
展开
-
forEach for 循环跳出问题
之所以写这篇文章是在实际使用中有一些困惑;那么在for循环中使用什么来跳出循环呢,在forEach中又是使用什么来结束循环呢?先看下代码function test(arr){ for (let i = 0; i < arr.length; i++) { console.log('1',arr[i]) if (i === 2){ break } } arr.forEach((item,index)原创 2022-01-20 17:32:34 · 1166 阅读 · 0 评论 -
ES6中 var let const详解
ES6中var let const的区别常量和变量的区别变量:值随时可变 常量:一旦定义之后,不可再改变var let const 详解var:会造成变量泄露,可以重复声明,但导致变量覆盖问题//author Avar time = null;doucument.onclick = function( time=set...)//author Cvar time =...原创 2020-03-14 12:50:12 · 223 阅读 · 0 评论