let div = document.querySelectorAll('div')
let e = [...div].map(el => {
el.style.width = '200px';
el.style.height = '50px';
el.style.border = '1px solid gray'
let colors = ['red','blue','yellow','green']
for (const color of colors) {
console.log(color)
el.style.backgroundColor = color
}
})
const div = document.querySelectorAll('div');
const colors = [ 'red','blue','yellow','green' ];
div.forEach((el, index) => {
el.style.width = '200px';
el.style.height = '50px';
el.style.border = '1px solid gray'
el.style.backgroundColor = colors[index];
});