Javascript 检查数组是否有字符串?
我在这个数组中设置了一些字符串Javascript 检查数组是否有字符串?,javascript,Javascript,我在这个数组中设置了一些字符串 如何检查此数组是否有字符串?您的意思是这样的吗 setTimeout(function() { abc[index].Factoid }, 2000); if (array.length > 0) {...} 如果数组有字符串,如何使用您的方法测试console.log true或false?我考不好。 $.each(array-name , function(){ return typeo
如何检查此数组是否有字符串?您的意思是这样的吗
setTimeout(function() {
abc[index].Factoid
}, 2000);
if (array.length > 0) {...}
如果数组有字符串,如何使用您的方法测试console.log true或false?我考不好。
$.each(array-name , function(){
return typeof this === 'string' ? true : false
});