@@ -88,7 +88,7 @@ p5.prototype.randomSeed = function(seed) {
8888 * @method random
8989 * @param {Number } [min] the lower bound (inclusive)
9090 * @param {Number } [max] the upper bound (exclusive)
91- * @return {Number|Object } the random number or a random element in choices
91+ * @return {Number|mixed } the random number or a random element in choices
9292 * @example
9393 * <div>
9494 * <code>
@@ -109,25 +109,17 @@ p5.prototype.randomSeed = function(seed) {
109109 * </div>
110110 * <div>
111111 * <code>
112- * // Get a random element from an array
113- * var words = [ "apple", "bear", "cat", "dog" ];
114- * var index = floor(random(words.length)); // Convert to integer
115- * text(words[index],10,50); // Displays one of the four words
116- * </code>
117- * </div>
118- * <div>
119- * <code>
120- * // Get a random element from an array
112+ * // Get a random element from an array using the random(Array) syntax
121113 * var words = [ "apple", "bear", "cat", "dog" ];
122114 * var word = random(words); // select random word
123- * text(word,10,50); // Displays one of the four words
115+ * text(word,10,50); // draw the word
124116 * </code>
125117 * </div>
126118 */
127119/**
128120 * @method random
129121 * @param {Array } choices the array to choose from
130- * @return {Object } the random element from the array
122+ * @return {mixed } the random element from the array
131123 * @example
132124 */
133125p5 . prototype . random = function ( min , max ) {
0 commit comments