If you do
alert("\fan")
It doesn't print \fan
. How do I make it so it prints it?
PS: This is like r"\fan"
in python.
If you do
alert("\fan")
It doesn't print \fan
. How do I make it so it prints it?
PS: This is like r"\fan"
in python.
The Javascript version of r"..."
is String.raw`...`
:
alert(String.raw`\fan`)
The backslash is used to escape special characters. If you want to use a literal backslash, a double backslash has to be used.
alert("\\fan")