Created
August 18, 2019 12:23
-
-
Save gokaybiz/35f8f1eec8e985d9055b5685f80c82b0 to your computer and use it in GitHub Desktop.
python's slice in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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