How To find max/min in a given array in javascript| Coding Interview Questions - #2 |

preview_player
Показать описание
Javascript Coding Interview Questions - #2 | Javascript Coding Challenge Interview Questions 2022
How To find max/min in a given array in javascript?
Javascript interview questions and answers, javascript techinacl questions, javascript interview coding exercises, javascript interview questions and answers 2020, javascript interview questions and answers 2019, javascript interview, javascript interview prep, javascript in 12 minutes

Javascript interview questions and answers series

Javascript Interview Questions and Answers - Part 1

Javascript Interview Questions and Answers - Part 2

J
Рекомендации по теме
Комментарии
Автор

To support us - Please subscribe to the channel.
Also, Please Like 👍, Comment ✍️ & Share 🤝. is really 🙏appreciated 😎.

veterancode
Автор

const numbers = [5, 2, 9, 1, 7];

const max = Math.max(...numbers);
const min = Math.min(...numbers);

console.log(max); // Output: 9
console.log(min); // Output: 1

KetanUniverseOfficial
Автор

we can also use this method
let array = [3, 7, 2, 9, 1, 8, 6];

let max = Math.max(...array);
let min = Math.min(...array);

console.log("Maximum value: " + max);
console.log("Minimum value: " + min);

tusharshrivas
Автор

const arr = [2, 1, 3, 6, 3, 2];
let arr2 = arr.sort()
console.log("min element is ", arr2[0], " max element is ", arr2[arr2.length-1]);

bikashdushad
Автор

you are confusing us between > and <, > this is greater and < this is lesser

gangavarapuabhishek
Автор

let lst = [12, 21, 332, 42, 21, 423, 14, 55];

let res = Math.max(...lst);

console.log(res);

AashMusic
Автор

Thanks bro for this amazing js playlist

AyanAli-cwvy
Автор

Hii bro, thanks for starting the js series. Please continue brother do regularly javascript important programs like this. If it is possible please make it in English language many people prefer english. Thanks 👍

CK-irke
Автор

Thanks a lot for this video. Keep posting more such stuff.

SAMANINOTV
Автор

Good job done. That's a great video.

Indianlifestyle
Автор

one line answer
const arr2 = arr.reduce((x1, x2) => x1 > x2 ? x1 : x2);

amitpadole
Автор

Aapko acche se bolna nahi aata itni speed ku kaha Jana hai tumhe. Bhut tej bhaag rhe ho

niteshsen
join shbcf.ru