Here is my code JS :
var items = [255, 255, 255, 255];
items.forEach(function(item) {
if (item = 255) {
item = 0;
};
});
console.log(items)
In console.log I get [255, 255, 255, 255]
, why it doesn't change to [0, 0, 0, 0]
? What am I doing wrong?