Created
July 1, 2020 13:28
-
-
Save aksnell/8ecc236dab4642ec9a93d461567f78e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function inAscOrder(arr) { | |
let prevNum = 0 | |
for (num of arr) { | |
if (num < prevNum) { | |
return false | |
} else { | |
prevNum = num | |
} | |
} | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment