for (var index = 0; index < myArray.length; index++) {
console.log(myArray[index]);
}
myArray.forEach(function (value) {
console.log(value);
});
for (var index in myArray) {
console.log(myArray[index]);
}
for (var value of myArray) {
console.log(value);
}
var a = ["a","b","c","d","e"];
for (var idx in a) {
console.log( idx );
}// 0 1 2 3 4
for (var val of a) {
console.log( val );
}// "a" "b" "c" "d" "e"
var m = new Map([['Michael', 95], ['Bob', 75], ['Tracy', 85]]);
m.get('Michael'); // 95
var m = new Map(); // 空Map
m.set('Adam', 67); // 添加新的key-value
m.set('Bob', 59);
m.has('Adam'); // 是否存在key 'Adam': true
m.get('Adam'); // 67
m.delete('Adam'); // 删除key 'Adam'
m.get('Adam'); // undefined
var s1 = new Set(); // 空Set
var s2 = new Set([1, 2, 3]); // 含1, 2, 3
var s = new Set([1, 2, 3, 3, '3']);
s; // Set {1, 2, 3, "3"}
var uniqueWords = new Set(words);
for (var word of uniqueWords) {
console.log(word);
}
for (var [key, value] of phoneBookMap) {
console.log(key + "'s phone number is: " + value);
}
for (var key of Object.keys(someObject)) {
console.log(key + ": " + someObject[key]);
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有