Essential JavaScript

Going Further

Min-Max Kata

Given an array of numbers, find the highest and lowest number among them.

Return an object with a min and max property representing the minimum and maximum values in the array.

For example:

const numbers = [13, 57, 89, 71, 12, 34, 29]; const result = findMinMax(numbers); console.log(result); // { "min": 12, "max" 89 }

There will always be at least one number in the array.

Code Editor

Click "Run Tests" to execute your function and see the test results below.

Test Results

Run your code to see test results

Console Output

// Console output will appear here...

0 output lines