The function should take an array, and compare the first item in an array with others. Eventually, it should print on console "True" if all the items an an array the same, and "False" otherwise. My function does the following:
function isUniform(list) {
var firstItem = list[0];
for (var i = 0; i <=list.length; i++){
i++
if(firstItem === list[i]){
console.log("True");
}else {
console.log("False");
};
};
}
input:
isUniform(['a','a','a'])
**********************
output:
VM512:6 True
VM512:8 False
Could you please give me some insight on what I should change?