Skip to content

Latest commit

 

History

History
121 lines (115 loc) · 4.32 KB

code-character-cheat-sheet.md

File metadata and controls

121 lines (115 loc) · 4.32 KB
layout title tags desc groups
cheatsheet
Code character cheat sheet
code character ascii keyboard square angle round bracket brace semi colon quote slash cheat sheet
A cheat sheet for common keyboard characters typed in code and what they’re called.
title items
Brackets
name details
`( )`
**Bracket**, round bracket, parentheses.
Used around function parameters in CSS and JavaScript.
`(`— open bracket.
`)`— close bracket.
name details
`[ ]`
**Square bracket**.
Used around attribute selectors in CSS and with arrays and objects in JavaScript.
`[`— open square bracket.
`]`— close square bracket.
name details
`{ }`
**Curly brace**, brace, moustache.
Used to open/close CSS rule sets or opening/closing objects and functions in JavaScript.
`{`— open curly brace.
`}`— close curly brace.
name details
`< >`
**Angle brackets**, less than/greater than.
Used to start and end HTML tags.
`<`— open angle bracket, less than.
`>`— close angle bracket, greater than.
title items
Quotes
name details
`"`
**Double quote**.
Used around attributes in HTML, around some values in CSS, and around strings in JavaScript.
Called straight quotes because they aren’t typographically correct.
name details
`'`
**Single quote**.
Used around attributes in HTML, around some values in CSS, and around strings in JavaScript.
Called straight quotes because they aren’t typographically correct.
name details
`“ ”`
**Double curly quote**.
Not used in code, but used in content.
Proper typographic quotes.
`“`— Mac shortcut:`⌥[`
`”`— Mac shortcut:`⌥⇧]`
name details
`‘ ’`
**Single curly quote**, apostrophe.
Not used in code, but used in content.
Proper typographic quotes.
`‘`— Mac shortcut:`⌥]`
`’`— Mac shortcut:`⌥⇧]`
name details
<code>`</code>
**Backtick**
Used in Markdown to denote code blocks.
title items
Slashes
name details
`/`
**Slash**, forward slash.
Used in paths and URLs as a folder separator.
name details
`\`
**Backslash**.
Used to escape characters in JavaScript.
name details
`|`
**Vertical pipe**.
Used in CSS attribute selectors; and in conditions in JavaScript, meaning “or”.
title items
Dashes
name details
`-`
**Dash**, hyphen, minus.
Used as a word separator in files, a hyphen in content & a minus in math.
name details
`–`
**En-dash**.
Used in content to represent a range.
Mac shortcut:`⌥-`
name details
`—`
**Em-dash**.
Used in content to set a piece of text apart, or denote speech that’s been cut off.
Mac shortcut:`⌥⇧-`
title items
Misc.
name details
`:`
**Colon**.
Used immediately after property names in CSS, before the value. Used in object declarations in JavaScript.
name details
`;`
**Semicolon**.
Used at the end of each declaration/line in CSS and JavaScript.
name details
`#`
**Hash**, pound-symbol.
Used to link to an ID, internally, in HTML, and as a symbol to denote an ID selector in CSS.
name details
`&`
**Ampersand**, and-symbol.
Used to start entities in HTML; and in conditions in JavaScript, meaning “and”.
name details
`_`
**Underscore**.
Can be used to separate words in file paths or function names in JavaScript.