I cannot recreate this behaviour in the SO snippet engine, but I'm coming across some pretty funky string manipulation behaviour in Chrome (v46).
Have a look at this screenshot of the Chrome JavaScript console:
To my mind, the result of the slice should be ( Here
. That is, a bracket and then three spaces. Not a bracket and then one space, which is what it is currently offering me.
I checked the exact same commands in Firefox, which yield the results I was expecting:
Can any one think of an explanation for the difference in output? Am I being dense?
Update
In regards to this being a duplicate of this, I believe this question does two things differently:
This is just a DevTools issue, which most probably has been addressed with the following patch http://src.chromium.org/viewvc/blink?view=revision&revision=201091
It's about collapsing multiple white characters, as HTML rendering is done by default. The mentioned patch forces rendering using white-space: pre
.
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