chknum
Check numeric params in Javascript.
See documentation here
Make it easy to read :
chknum(x)isInt().greaterThan(5).lesserThan(10);
chknum(x).gt(5).lt(10);
more compact and readable than :
if x > 5 && x < 10 else throw ;
Example :
var chknum ; { // This will check if the number is an integer. ; // This will check if the number is a float. ; // This will throw a RangeError if x does'nt match. ; // Also work like this : ; ; // Or chknum(y).neg(); ; // Or chknum(y).pos(); ; ; // Or chknum(z).btw(0,322); ; // Or chknum(z).eq(200);}