+ 1
javascript check values help answer code
// Expected Result = true // Direction : need to check if each of array value has value less than 91 const array1 = [1, 29, 88, 37, 22, '90']; function result(array1) { // Your Code Here } console.log(result(array1));
3 Réponses
+ 1
Use Array::every method. It returns a boolean true when all elements matches a qualification
function result(a)
{
return a.every( value => value < 91 );
}
https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/array/every
+ 1
by using array method called filter
array1.filter(num=>{
return num<91;
});