Skip to content

Instantly share code, notes, and snippets.

@jakehemmerle
Created June 11, 2021 00:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakehemmerle/d2ebadb151d667dfc6acca370ddc7d68 to your computer and use it in GitHub Desktop.
Save jakehemmerle/d2ebadb151d667dfc6acca370ddc7d68 to your computer and use it in GitHub Desktop.
a guy
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);
@jakehemmerle
Copy link
Author

just run node ./guy.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment