Skip to content
loading...

re: Rando.js: replacing Math.random() VIEW POST

FULL DISCUSSION
 

Looks promising! Is this library a pseudorandom one like Math.random or is it a true random algorithm?

 

It is using Math.random, just added sugar around it.
Made a ton prototypes long time ago for such tasks

Array.prototype.getRandom = function () {
    return this[Math.floor(Math.random() * this.length)];
};
console.log( [1, 2, 3].getRandom() )
 
code of conduct - report abuse