Edit in JSFiddle

const colors = ['red', 'blue', 'green'];

console.log('## for-in ##');
for (var index in colors) {
	console.log( colors[index] );
}

console.log('## for-of-for ##');
for (var value of colors) {
	console.log( value );
}