0

How to make random in js? Random 1-50 no greater than 50

29th Jun 2016, 12:39 PM
JS of MC(not C++ || java)
JS of MC(not C++ || java) - avatar
6 odpowiedzi
0
\\seems to work fine var x=Math.random()*50 console.log(x)
30th Jun 2016, 3:07 AM
Cocoa
Cocoa - avatar
0
apologies, i did the comment backwards //
30th Jun 2016, 3:09 AM
Cocoa
Cocoa - avatar
0
//if you needed it to be rounded and not a decimal //try this. var x=Math.random()*50 console.log(Math.round(x))
30th Jun 2016, 3:13 AM
Cocoa
Cocoa - avatar
0
Thnx very much :) It help me a lot but it's not work ya
30th Jun 2016, 7:26 AM
JS of MC(not C++ || java)
JS of MC(not C++ || java) - avatar
0
I know it works! but Learn HTMl isnt work but browser is work
27th Aug 2016, 6:33 PM
JS of MC(not C++ || java)
JS of MC(not C++ || java) - avatar
0
Thnx Cocoa :)
27th Aug 2016, 6:33 PM
JS of MC(not C++ || java)
JS of MC(not C++ || java) - avatar