DEV Community

Discussion on: Rando.js: replacing Math.random()

Collapse
 
waylonwalker profile image
Waylon Walker • Edited

Hot tip, include language after the leading backticks for codeblocks to get food syntax hilighting.

example

result

randoSequence(5)  
   //a random integer between 5 and 10 (could be 5 or 10)  

   randoSequence(5, 10)  
   // an array of integers from 5 through 10 in random order  

   randoSequence(["eeny", "meeny", "miny", "moe"])  
   // array of {index:..., value:...} objects representing the values of the provided array in random order  

   randoSequence({species: "mouse", blind: true, count: 3})  
   // array of {key:..., value:...} objects representing the properties of the provided object in random order  

   randoSequence($("input"))  
   // array of {index:..., value:...} objects representing a jQuery elements from the provided jQuery element set in random order  

   randoSequence("Good gravy!")  
   // the characters of the provided string in random order  

   randoSequence(null)  
   // ANY invalid arguments return false

EDIT 🤣 corrected hot too to hot tip

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

food syntax 🌭

Unexpected hotdog.
Collapse
 
nastyox1 profile image
nastyox

Nice tip. Thanks :)