Skip to content

Instantly share code, notes, and snippets.

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 01Clarian/d9ac9e62a0e80bfa1f2e2bb1a1e87bf2 to your computer and use it in GitHub Desktop.
Save 01Clarian/d9ac9e62a0e80bfa1f2e2bb1a1e87bf2 to your computer and use it in GitHub Desktop.
index.js
function inclusiveArrayParam(startVal, endVal) {
const arr = []
for(let i = startVal; i <= endVal; i++) {
arr.push(i)
}
return arr
}
console.log('iterative inclusive array solution: ', inclusiveArrayParam(2, 6))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment