| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
We don't like let statements, especially combined with if/else statements. Prefer const.
Good:
const foo = condition ? 1 : 2Bad:
let foo
if (condition) foo = 1
else foo = 2Prefer early returns or using an iife to avoid else statements.
Good:
function foo() {
if (condition) return 1
return 2
}Bad:
function foo() {
if (condition) return 1
else return 2
}Try your best to find a single word name for your variables, functions, etc. Only use multiple words if you cannot.
Good:
const foo = 1
const bar = 2
const baz = 3Bad:
const fooBar = 1
const barBaz = 2
const bazFoo = 3| Back | FazBrowse Home | New Git URL |