Skip to content
Snippets Groups Projects
Commit 328c6eef authored by corncobman21's avatar corncobman21
Browse files

Rename random functions

parent a3e31b38
No related branches found
No related tags found
1 merge request!1225Add random JS functions
...@@ -401,11 +401,11 @@ window.numberWithCommas = function(x) { ...@@ -401,11 +401,11 @@ window.numberWithCommas = function(x) {
} }
window.random = function(min,max) { window.jsRandom = function(min,max) {
return Math.floor(Math.random()*(max-min+1)+min); return Math.floor(Math.random()*(max-min+1)+min);
} }
window.randomMany = function (arr, count) { window.jsRandomMany = function (arr, count) {
var result = []; var result = [];
var _tmp = arr.slice(); var _tmp = arr.slice();
for (var i = 0; i < count; i++) { for (var i = 0; i < count; i++) {
...@@ -415,7 +415,7 @@ window.randomMany = function (arr, count) { ...@@ -415,7 +415,7 @@ window.randomMany = function (arr, count) {
return result; return result;
} }
window.either = function(choices) { window.jsEither = function(choices) {
var index = Math.floor(Math.random() * choices.length); var index = Math.floor(Math.random() * choices.length);
return choices[index]; return choices[index];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment