Skip to content

Instantly share code, notes, and snippets.

@ubermachine
Created January 6, 2021 06:47
Show Gist options
  • Save ubermachine/5e1a3fb04bc774c6faa453e65bf875bf to your computer and use it in GitHub Desktop.
Save ubermachine/5e1a3fb04bc774c6faa453e65bf875bf to your computer and use it in GitHub Desktop.
function range(start,end) {
if(start&&end){
return Array.from({length:end-start+1},(_,i)=>start++)
}
else{
return function range2(end){
return Array.from({length:end-start+1},(_,i)=>start++)
}
}
}
let f=range(3);
f(8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment