0
Hey Guys! What does the .toFixed() and toString() do and its use?
Thanks Guys!
2 ответов
+ 2
Taken from https://cheeze.club/bhfw
var numObj = 12345.6789;
numObj.toFixed(1); // Returns '12345.7': note rounding
numObj.toFixed(6); // Returns '12345.678900': note added zeros
Read more on .toString() here https://cheeze.club/ds4l
Every object has a toString() method that is automatically called when the object is to be represented as a text value or when an object is referred to in a manner in which a string is expected.
0
Thanks a Lot!