Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function minNumber(input) {
- let index = 0;
- let command = input[index];
- index++;
- let minNum = Number.MAX_SAFE_INTEGER;
- while (command !== "Stop") {
- let currentNumber = Number(command);
- if (currentNumber < minNum) {
- minNum = currentNumber;
- }
- command = input[index];
- index++;
- }
- console.log(`${minNum}`);
- }
Advertisement
Add Comment
Please, Sign In to add comment