How to get largest and smallest number in an array?
Answer / Nitin
In JavaScript, you can use the Math.min() and Math.max() functions along with the spread operator (...) to find the minimum and maximum values of an array. Example: const arr = [1, 2, 3]; console.log({ min: Math.min(...arr), max: Math.max(...arr) });
| Is This Answer Correct ? | 0 Yes | 0 No |
What is difference between tree and forest?
How would you dynamically allocate a one-dimensional and two-dimensional array of integers?
What is a undirected graph?
Differentiate linear from a nonlinear data structure?
Explain Array
Which collection class is thread safe?
What is binary search in data structure?
What are the two traversal strategies used in traversing a graph?
There are 8, 15, 13, 14 nodes were there in 4 different trees. Which of them could have formed a full binary tree?
What are the four types of variables?
Is treemap sorted?
Is array a dynamic data structure?