大家好,今天分享一下JavaScript Iterable迭代
使用Iterable来遍历迭代map和set
看源码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
'use strict';
var arr =[3,4,5]
for (var x in arr ){
console.log(x) //列出数组元素的下标
}