Answers for "find biggest number in javascript array"

9

find biggest number in javascript array

var peopleData = [ 
    { name: "Paul", height: 180, age: 21 },
    { name: "Johnny", height: 198, age: 43 },
    { name: "Brad", height: 172, age: 49 },
    { name: "Dwayne", height: 166, age: 15 }
];

//Find biggest height number
var maxHeight = 0;

for (var i = 0; i < heights.length; i++) {
    if (peopleData[i].height > maxHeight) {
        maxHeight = peopleData[i].height;
      //if you console.log(maxHeight); you should get 198
    }
}
Posted by: Guest on May-19-2021
5

javascript largest number in array

const max = arr => Math.max(...arr);
Posted by: Guest on July-02-2020
8

get largest number in array javascript

const array1 = [1, 3, 2];

Math.max(...array1);
// expected output: 3
Posted by: Guest on August-07-2020
0

find highest value in array javascript

const array = [10, 2, 33, 4, 5];

console.log(Math.max(...array)
)
Posted by: Guest on February-07-2021
1

function that search a biggest value in array javascript

function maisBaratosQue(valor, precos) {
   return precos.filter(p => p <= valor);
}
Posted by: Guest on September-18-2020

Code answers related to "find biggest number in javascript array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language