Is there a way to block out quotes or double quotes in a console.log("") so that they print on screen?

I’m a complete beginner in JavaScript, and I wanted to know if there was a way to block double and single quotes. Like this: console.log("“Hello fellow adventures!” said Tim. He liked to act like he was on tv sometimes.") I like to make things like this in Python, using just a slash to block out the double quotes so it would look like this: print("/“Hello fellow adventurers!/” said Tim. He liked to act like he was on tv sometimes."). The slashes would make the quotes show up on screen and not mess anything up. I don’t know if there is anything like that in JavaScript. Any suggestions would be greatly appreciated!

To quote a phrase in a sentence, either use alternate quotes on the string, or use escapement…

console.log("Then he said, \"Please, can you repeat that?\"")

Thank you so much for your help!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.