diff --git a/lib/random/random.js b/lib/random/random.js index 9e482c1..3811eef 100644 --- a/lib/random/random.js +++ b/lib/random/random.js @@ -50,7 +50,7 @@ var random = { // eslint-disable-line no-unused-vars return Math.exp(this.float() * Math.log(limit)) }, item: function (list) { - if (list === undefined || typeof list === 'string' || !list.hasOwnProperty('length')) { + if (list === undefined || typeof list === 'string' || list.length === undefined) { logger.traceback() throw new TypeError('random.item() received an invalid object: \'' + list + '\'') }