You have an array [1,0,1,0]. Using expression print the given array on the page, and each element should be placed in a div. If the element is 1, then the div must have a class of white, if 0 is black.
this.state = {
array2: [1, 0, 1, 0]
};
}
{this.state.array2.map(elem => {
return <div>{elem}</div>
})}