Skip to content

Instantly share code, notes, and snippets.

@gokaybiz
Created August 18, 2019 12:23
Show Gist options
  • Save gokaybiz/35f8f1eec8e985d9055b5685f80c82b0 to your computer and use it in GitHub Desktop.
Save gokaybiz/35f8f1eec8e985d9055b5685f80c82b0 to your computer and use it in GitHub Desktop.
python's slice in javascript
Array.prototype.plice = function (el) {
return ((el == -1) ? this.slice(el) : this.slice(el, el+1))[0] || undefined
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment