Perché 2..toString()
restituisce 2
ma 2.toString()
genera questo errore?Perché 2..toString() funziona?
Esempio:
console.log(2..toString()); // prints 2
// Firefox throws the error
// `SyntaxError: identifier starts immediately after numeric literal`
console.log(2.toString());
var x = 2;
console.log(x.toString()); // prints 2
// Firefox throws the error
//`TypeError: XML descendants internal method called on incompatible Number`
console.log(x..toString());
(2) .toString() restituisce il risultato previsto. (non una risposta ma un test ...) –
Anche IE dà errore? – DevelopmentIsMyPassion
Lo so ma perché anche '2..toString()' funziona? –