I'm not getting the point why calls to the join
and toString
methods on an Array object return an empty string after a call to toLocaleString
:
let A = [1, 2, 3];
A.toString(); => "1,2,3"
A.join(); => "1,2,3"
A => (3) [1, 2, 3]
A.toLocaleString(); => ""
A.toString(); => ""
A.join(); => ""
A => (3) [1, 2, 3]
I'm trying on Google Chrome 73.0.3683.103, on Firefox I don't experience the same issue.
This is a bug
To fix this issue, you can use this way:
[...A].toLocaleString();
//or
[].concat(A).toLocaleString();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With