Challenge: Find Minimum Value in Array

Given an array of size "n". Can you find the minimum value in the array? Implement your solution in JavaScript and see if your output matches the expected output.

Problem Statement #

Implement a function findMinimum(arr) that finds the smallest number in the given array.

Input #

An array of integers

Output #

The smallest number in the array

Sample Input #

arr = [9,2,3,6]

Sample Output #

2

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.