I hate Maths (or Math as it’s known in some parts). I hate it because I’m rubbish at it, I don’t understand it, it does my head in, and it doesn’t excite me at all.

That said, I recently learned some stuff that the Javascript Math object can do that I can see I will use in the future, so I’m documenting it here.

### Math.min/Math.max

Find the lowest/highest number in a range

### Math.floor/Math.ceil

Round a floating point number down/up to the next integer

### Math.round

Round a floating point number to the nearest integer

### Math.random

Return a random number between 0 and very close to 1, e.g.

This means you can do this to get a random integer within a desired range:

### Rounding

Not Math methods but hey…

### isNaN

Check if a value is a number or not, returns true if not a number