Created
November 26, 2020 04:57
-
-
Save animanoir/d7df7a54fb130a9e48d355961be647f6 to your computer and use it in GitHub Desktop.
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
// Forma elegante de sacar un item al azar de un array desde una función. | |
Array.prototype.random = function () { | |
return this[~~(Math.random() * this.length - 1)] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment