Interesting little pickle:
I was using JSbin to practice converting single quotes to double quotes. The readout in the JSbin console kept inexplicably giving me "\"
. Then when I tried running the same code in the chrome console, the switch worked fine. (Yes, I am aware that it converted the '
in "I'm"--that is not the question at hand though.)
Any idea why jsbin might have given me those backslashes in the console output?
Since my comment didn't satisfy you, let's look at the sources.
Chrome dev tools, ConsoleViewMessage.js:
elem.createTextChild("\"");
elem.appendChild(elementWhichHoldsOurString);
elem.createTextChild("\"");
As you can see, the dev tools writes an a double quote, followed by our string, followed by another double quote.
jsbin, proxy-console.js is what handles your console.log
arguments. As you can see, it calls stringify, which explicitly escapes double quotes in strings.