Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Escape character
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===JavaScript === JavaScript uses the {{code|\}} (backslash) as an escape character for:<ref>{{cite web|url=http://mathiasbynens.be/notes/javascript-escapes |title=JavaScript character escape sequences |publisher=Mathias Bynens |date=21 December 2011 |access-date=2014-06-30}}</ref><ref>{{cite web|url=http://msdn.microsoft.com/en-us/library/2yfce773%28v=vs.94%29.aspx |title=Special Characters (JavaScript) |publisher=Microsoft Developer Network |access-date=2014-06-30 |url-status=live |archive-url=https://web.archive.org/web/20141214014640/http://msdn.microsoft.com/en-us/library/2yfce773(v=vs.94).aspx |archive-date= Dec 14, 2014 }}</ref> * {{code|\'}} single quote * {{code|\"}} double quote * {{code|\\}} backslash * {{code|\n}} [[newline|new line]] * {{code|\r}} [[carriage return]] * {{code|\t}} tab * {{code|\b}} backspace * {{code|\f}} [[form feed]] * {{code|\v}} [[vertical tab]] ([[Internet Explorer 9]] and older treats {{code|'\v}} as {{code|'v}} instead of a vertical tab ({{code|'\x0B}}). If cross-browser compatibility is a concern, use {{code|\x0B}} instead of {{code|\v}}.) * {{code|\0}} [[null character]] ({{unichar|0}}) (only if the next character is not a decimal digit; else it is an octal escape sequence) * {{code|\xFF}} character represented by the hexadecimal byte <code>FF</code> The {{code|\v}} and {{code|\0}} escapes are not allowed in JSON strings. Example code:<syntaxhighlight lang="javascript"> console.log("Using \\n \nWill shift the characters after \\n one row down") console.log("Using \\t \twill shift the characters after \\t one tab length to the right") console.log("Using \\r \rWill imitate a carriage return, which means shifting to the start of the row") // can be used to clear the screen on some terminals. Windows uses \r\n instead of \n alone </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)