console.log("Hello World") //prints "Hello World" to the console
console.log("Hello World/rBye ") // prints "Bye World" to the console.
\r is “Carriage Return”. Litterly it moves the text output point to the start of the line without moving to the next line.
Hence you see "Bye " overwriting “Hello”
This is why some traditional systems (like DOS and probably Windows) use CR LF pairs for end of line markers rather than just plain CR (as traditional Mac does) or LF (as traditional Unix (and hence modern Mac) does)
Use \n (linefeed) instead.
Note that the handling of \r and \n varies wildly from place to place even on the Mac, and even more so across platforms.
Really?! I never knew that’s what carriage return meant! Makes a lot more sense now. I know from experience in VB6 to create a new line you use vbCrLf - carriage-return line-feed - but never really understood what carriage-return was. Thanks for the info!