Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function minNumber(input) {
- let inputElement = input[0];
- let index = 1;
- let min = Number.MAX_SAFE_INTEGER;
- while (inputElement !== "Stop") {
- let num = Number(inputElement);
- if (min > num) {
- min = num;
- }
- inputElement = input[index];
- index++;
- }
- console.log(min);
- }
- minNumber(["100", "99", "80", "70", "Stop"])
Advertisement
Add Comment
Please, Sign In to add comment