Thursday, July 3, 2014

Generate Random number from 1 to N in javascript

//random number from 1 to N
var random = Math.floor(Math.random() * N + 1);

No comments:

Post a Comment