Number Methods:

object.nameOfTheMethod(argument);

Methods:

  1. Number.parseInt();
  2. Parses a "string" and returns a whole number:

    Number.parseInt("1");

    Number.parseInt("3.14");

    Number.parseInt("Hello");

  3. Number.parseFloat();
  4. Parses a "string" and returns a floating point number:

    Number.parseFloat("1");

    Number.parseFloat("3.14");

    Number.parseFloat("Hello");

  5. Number.is?();
  6. Checks if type is a number or not. Boolean result: True = number. False = not a number.:

    Number.isFinite(123);

    Number.isFinite("123");

    Number.isInteger(3);

    Number.isInteger(3.14);

    Number.isInteger("3.14");

    Number.isNaN(3);

    Number.isNaN("3");

    Number.isNaN("Hello");

  7. variable.toString()
  8. Parses an integer into a "string":

    1.toString();

    variable.toString();

    variable.toString(base#);

  9. variable.toFixed(n)
  10. Parses a floating point number into a "string":

    3.1415926.toFixed(0);

    3.1415926.toFixed(4);

    3.1415926.toFixed(10);