Please help here I wanna print in the console all array elements in condition that they are not numbers and they do not start with letter "A"
I think the problem is where to put the i += 1; but actually when I am changing its position the output is not what like I need.
I tried to do it with for and every thing turned out okay, but I don't know what is the problem with while.
Here is the code:
let friends = ["Ahmed", "Sayed", "Ali", 1, 2, "Mahmoud", "Amany"];
let i = 0;
while (i < friends.length) {
if (friends[i][0] === "A" || typeof friends[i] === "number") {
continue;
}
console.log(friends[i]);
i += 1;
}
I tried to use while to do what I've said previously