/*
extendm.js adds some simple maths system into the base Number object of JS meaning you dont need to define methods in your code check certain things
*/
// isInt & isFloat
var test1 = 1;
var test2 = 1.4;
test1.isInt(); // returns true;
test1.isFloat(); // returns false;
test2.isInt(); // returns false;
test2.isFloat(); // returns true;
// isEven & isOdd
var test1 = 1;
var test2 = 2;
test1.isEven(); // returns false;
test1.isOdd(); // returns true;
test2.isEven(); // returns true;
test2.isOdd(); // returns false;
// random numbers
Number.random(); // returns a random number
Number.random(19); // returns a random number between 0 and 19
Number.random(10,20); // returns a random number between 10 and 20
// date support
var test = 1378032235;
test.toDate();// returns Date Object in "Sun Sep 01 2013 11:43:55 GMT+0100 (GMT Daylight Time)"
// to boolean
var test1 = 0;
test1.toBoolean(); // returns true;
var test2 = 1;
test2.toBoolean(); // returns false;
var test3 = 2;
test3.toBoolean(); // throws exception |