I am trying to loop through an array and check if it contains an integar but i cant get it to work and i dont understand why. Do I have to use the map method?
My code is like this:
let words = ['Dog', 'Zebra', 'Fish'];
for(let i = 0; i <= words.length; i++){
if(typeof words[i] === String){
console.log('It does not contain any Numbers')
}
else{
let error = new Error('It does contain Numbers')
console.log(error)
}
}