Skip to content

Instantly share code, notes, and snippets.

@NuckChorris
Forked from anonymous/gist:3802186
Created September 28, 2012 21:33
Show Gist options
  • Save NuckChorris/3802190 to your computer and use it in GitHub Desktop.
Save NuckChorris/3802190 to your computer and use it in GitHub Desktop.
var substring = function(all, start, end) {
if (start >= end) {
console.log(all[start]);
} else {
return all[start] + substring(all, start + 1, end);
}
};
console.log(substring("lorem ipsum dolor", 6, 10));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment