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