Javascript 1.6 数组新增方法介绍之 every() – 示例

测试数组大小:

代码:
function isBigEnough(element, index, array) {
	return (element >= 10);
}
var passed = [12, 5, 8, 130, 44].every(isBigEnough);
// passed is false
passed = [12, 54, 18, 130, 44].every(isBigEnough);
// passed is true
结果: