Number Object in JavaScript || Methods and Properties of Number Object ||JavaScript Tutorial

Pubblicato il: 19 maggio 2023
sul canale di: Sudhakar Atchala
1,225
20

#numberobject #javascripttutorialforbeginners #javascript
Number object in JavaScript:-
---------------------------------------
The Number object in JavaScript is a built-in object that represents numbers.
It can be used to work with numbers in JavaScript.

To create a Number object, we can use the Number() constructor. The Number() constructor takes a number as its argument.

var a = new Number(10);

Methods of Number object:-
-----------------------------------
1. toString(): Converts a number to a string.
2.toFixed() : Returns the value of the Number object as a string with a specified number of decimal places.
3.toPrecision(): Returns the value of the Number object as a string with a specified length
4.toExponential(): Returns the value of the Number object as a string in exponential notation.
5.parseInt(): Parses a string and returns an integer.
6.parseFloat(): Parses a string and returns a floating-point number.


Properties of Number object:
---------------------------------------

MAX_VALUE: The maximum representable number in JavaScript.
// 1.7976931348623157e+308
MIN_VALUE: The smallest representable positive number.
// 5e-324
NEGATIVE_INFINITY: A value representing negative infinity.
// -Infinity
POSITIVE_INFINITY: A value representing positive infinity.
// Infinity
NaN: A special value representing "Not-a-Number".
// NaN


In questa pagina del sito puoi guardare il video online Number Object in JavaScript || Methods and Properties of Number Object ||JavaScript Tutorial della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Sudhakar Atchala 19 maggio 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,225 volte e gli è piaciuto 20 spettatori. Buona visione!