ToString()




Il metodo toString()
Il toString()metodo restituisce un numero come stringa.

Tutti i metodi numerici possono essere utilizzati su qualsiasi tipo di numero (letterali, variabili o espressioni):

Esempio
let x = 123;
x.toString(); // returns 123 from variable x
(123).toString(); // returns 123 from literal 123
(100 + 23).toString(); // returns 123 from expression 100 + 23










( tostring.html )- by Paolo Puglisi - Modifica del 17/12/2023