📅  最后修改于: 2022-03-11 15:02:13.957000             🧑  作者: Mango
//for in, iterates keys in an object
var obj={a:1, b:2}
for( var key in obj)
console.log(obj[key]); //would print 1 and 2
//for of, iterates values in array or any iterable
var ar = [10, 11, 12, 13]
for (var item in ar )
console.log(item); //would print 10 11 12 13