for … in

for … of

for … in과 for … of의 차이점

Object.prototype.objCustom = function () {};
Array.prototype.arrCustom = function () {};

let iterable = [3,5,7];
iterable.foo = "Hello";

for(let i in iterable) {
	console.log(i);
}
// 0, 1, 2, "foo", "arrCustom", "objCustom"

for(let i of iterable){
	console.log(i);
}
// 3, 5, 7