console.log Stripping Carriage Returns (displaying as a literal ↵)
firebug, google-chrome-devtools, javascript
Solution
Chrome will render `\n` as `↵` when printing objects that contain multi-line strings. However, you can simply double-click on the logged string to see it with proper newlines.
Problem
I'm trying to write a JavaScript function that prints a string to the console via console.log. However, the string has carriage returns in it, which show up as a literal ↵ character instead of creating a new line. Is this a limitation of console.log, or is there a way around this? Thanks! Edit: I'm actually trying to print this function inside an object. Something like: ``` function blah() { }; console.log({ "function" : blah }); ``` I didn't think to mention it initially, but after trying crowjonah's solution I realize that console.log apparently treats strings passed directly differently from strings passed inside another object.