Convert Number to int - Node.js Number

Node.js examples for Number:Int

Description

Convert Number to int

Demo Code


Number.prototype.toInt = function() {
  return (this | 0);
};

Array.prototype.random = function() {
  return this[ Math.floor(Math.random() * this.length) ];
};

Related Tutorials