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