I am trying to loop through an array, and if an element is equal to a set of values I want to update that element. So for example:
var arr = ["apple", "orange", "banana", "kiwi"];
for(var x= 1; x < arr.length; x++) {
if(arr[x] === kiwi" || "banana") {
arr[x] = arr[x] + "1";
}
}
Expected output
arr = ["apple", "orange", "banana1", "kiwi1"];
I can't seem to get this right.
EDIT: Sorry about the typo's the code copied over wrong, I have fixed the typo's.