get random numbers javascript

JavaScript
//Write the following code to get a random number between 0 and n
Math.floor(Math.random() * n);Math.floor(Math.random() * 10);Math.floor(Math.random() * 10) + 1Math.random()
Source

Also in JavaScript: