Created
November 12, 2015 06:18
-
-
Save yesoreyeram/5aaaa3d03b9919739345 to your computer and use it in GitHub Desktop.
Javascript Helpers
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
// Pick random element in arry | |
var randomElementInArray = function(arrayOfElements){ | |
return arrayOfElements[Math.floor(Math.random() * arrayOfElements.length)]; | |
} | |
// usage : randomElementInArray(['apple','boy','cat']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment