Created
June 11, 2021 00:40
-
-
Save jakehemmerle/d2ebadb151d667dfc6acca370ddc7d68 to your computer and use it in GitHub Desktop.
a guy
This file contains 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
let inputVal = 512; | |
let x = [0]; | |
let value = 1; | |
let step = 1; | |
let nextBase = 10; | |
while (value < inputVal) { | |
x.push(value); | |
value += step; | |
if (value === nextBase) { | |
nextBase *= 10; | |
step *= 10; | |
} | |
} | |
x.push(inputVal); | |
console.log(x); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just run
node ./guy.js