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