Greetings
This is another short and sweet posts, basically it involves using the Math. function to do some nifty tricks
Lets say that you want to get a random number between 1 and 10 and you dont know how. Well the answer is quite easy and it involves combining 2 Math. functions. Math.floor() and Math.random().
This function takes a random number between 0 and 1
This function rounds a number down to it’s smaller number, for example. 4.4 would become 4, 4.6 would become 4 as well, -4.1 would become -5 as well as -4.6 would become -5 as well.
Tags: Javascript, Javascript comparing numbers
Categories: Javascript, jQuery
Posted By: Dinulescu Alexandru Adrian
Last Edit: 14 Feb 2010 @ 11:37 PM
Recent Comments