线性数据结构的遍历
摘要:
```js // 数组的遍历 // 创建一个数组 arr = [1, 2, 3, 4, 5, 6] const traverseArr = arr => { // 遍历数组的方法 if (arr null) { // 判空,如果当前数组为空,直接结束 return } for (const item of arr) { // 数组属于可迭代对象,可以使用for-of循环进行遍历 console.l 阅读全文
posted @ 2020-01-09 20:32
夜殇、
阅读(168)
评论(0)
推荐(0)