Sha256: 43252e8453b4418d4e33330b1e1705a0dd837c8ce65f6610758cf243f7c55a18
Contents?: true
Size: 407 Bytes
Versions: 69
Compression:
Stored size: 407 Bytes
Contents
define(['./randInt', '../lang/isArray'], function (randInt, isArray) { /** * Returns a random element from the supplied arguments * or from the array (if single argument is an array). */ function choice(items) { var target = (arguments.length === 1 && isArray(items))? items : arguments; return target[ randInt(0, target.length - 1) ]; } return choice; });
Version data entries
69 entries across 69 versions & 2 rubygems