Created
June 28, 2019 19:02
-
-
Save amejiarosario/baeccdbf773f127b91f07dd6b8a3acd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get the smallest number on an array of numbers | |
* @param {Array} n array of numbers | |
*/ | |
function getMin(n) { | |
const array = Array.from(n); | |
let min; | |
array.forEach(element => { | |
if(min === undefined || element < min) { | |
min = element; | |
} | |
}); | |
return min; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment