Rename random.index to random.item

This commit is contained in:
Christoph Diehl 2017-04-07 16:59:10 +02:00
parent e03a4b431e
commit ba5f56cd0b

View file

@ -34,7 +34,7 @@ var random = {
// Returns a float in [1, limit]. The logarithm has uniform distribution. // Returns a float in [1, limit]. The logarithm has uniform distribution.
return Math.exp(random.float() * Math.log(limit)); return Math.exp(random.float() * Math.log(limit));
}, },
index: function (list) { item: function (list) {
if (!(list instanceof Array || (typeof list != "string" && "length" in list))) { if (!(list instanceof Array || (typeof list != "string" && "length" in list))) {
Utils.traceback(); Utils.traceback();
throw new TypeError("random.index() received a non array type: '" + list + "'"); throw new TypeError("random.index() received a non array type: '" + list + "'");