/ Published in: JavaScript
Usage: random_integer(1,100);
Expand |
Embed | Plain Text
/* Receives the lowest and highest values of a range and returns a random integer that falls within that range. */ function random_integer(low, high) { return low + Math.floor(Math.random() * (high - low)); }
You need to login to post a comment.
