Check values in the Array is a String
Given an array
Sample Input 1
[ 'frozen', 'rock', 'stained', 'basket' ]
Sample Output 1
true
Sample Input 2
[ 'recycling', 70, 'pastime', 'animal' ]
Sample Output 2
false
function check(num1){
if(isNaN(num1)){
document.write(num1 + " is a number <br/>");
}else{
document.write(num1 + " is not a number <br/>");
}
}
const num1 = ["Ravi", "yadav"];
console.log(num1.every(check(num1)));
Comments
Leave a comment