Neden 2..toString()
2
döndürüyor, ancak 2.toString()
bu hatayı atar?Neden 2..toString() çalışıyor?
Örnek: 2.
2.0
olarak ayrıştırılır, çünkü bu
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() beklenen sonucu verir. (bir cevap değil, bir test ...) –
IE de hata veriyor mu? – DevelopmentIsMyPassion
Biliyorum ama neden 2..toString() 'de çalışıyor? –