Exploring Number methods in detail || toString() || toPrecision() || toExponential() || toFixed()

Exploring Number methods in detail || toString() || toPrecision() || toExponential() || toFixed()

Star Technophile

54 года назад

83 Просмотров

Hi star Technophile ,
This is a very Important video regarding a number methods , Here i have mention intuitive understanding regarding number functions .

Here is the list some example :
👉 toString()

example : let x = 10
let num = x.toString()
console.log(num) // 10


👉 toExponential()
example :
let x = 456.789
let num = x.toExponential()
console.log(num) // Output: 4.56789e+2

👉 toFixed()
example :
var num = 1.23e+2;
console.log(num.toFixed());

👉toPrecision()
example :
var num = 456.789;
console.log(num.toPrecision()) // Output : 456.789
console.log(num.toPrecision(2)) // Output : 4.6


These are very simple examples , Just practice them on a console you will get a huge understanding and confidence after doing all these function

Тэги:

#javascript #javascriptDeveloper #numbermethods #numbermethodsindetails #methods #toString #toPrecision #toExplonential #toFixed #to #toFixed()in_javascript #toExponential()in_javascript #toPrecision()in_javascript #toString()in_javascript
Ссылки и html тэги не поддерживаются


Комментарии: