Skip to content

Instantly share code, notes, and snippets.

@johnhutchins
Created April 27, 2020 13:06
Show Gist options
  • Save johnhutchins/6b102fa833a4ccf6de35f7d6ea09df09 to your computer and use it in GitHub Desktop.
Save johnhutchins/6b102fa833a4ccf6de35f7d6ea09df09 to your computer and use it in GitHub Desktop.
generate array of numbers in between two numbers
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