Created
June 13, 2019 15:54
-
-
Save v-stickykeys/f16a955ca5fa38081cba276513f5527c to your computer and use it in GitHub Desktop.
JavaScript Syntax Rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Comments | |
/** | |
* Describes what the function does and ends with a period. | |
* | |
* This is space to provide more explanation. | |
* @param { type } paramName Optionally provide more info. | |
* @return { type } Optionally provide more info. | |
*/ | |
*/ | |
/* Ordering | |
// It should be understandable when read top to bottom | |
// Don't make me jump around | |
// Prioritize alphabetical | |
// Logical supercedes alphabetical | |
*/ | |
/* Indentation | |
2 spaces | |
Always and forever | |
*/ | |
/* Arrays and Objects | |
// Put each item on a new line if the entire collection exceeds 70 characters in width. | |
[ | |
do, | |
it, | |
like, | |
so, | |
] | |
// End each item with a comma, even the last one. | |
*/ | |
/* Return Statements | |
return statement; | |
// Use parentheses to avoid ASI errors | |
return ( | |
a + b | |
); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment