Created
April 27, 2020 13:06
-
-
Save johnhutchins/6b102fa833a4ccf6de35f7d6ea09df09 to your computer and use it in GitHub Desktop.
generate array of numbers in between two numbers
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 generateIntegers(m, n) { | |
let arr = [] | |
let init = m | |
let length = (n - m) + 1 | |
while(arr.length < length){ | |
arr.push(init) | |
init = init + 1 | |
} | |
return arr | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment