random trong js

JavaScript
Math.random() * (b - a) + a;
Source

Also in JavaScript: