- [CODE STYLE]: don't use
for inloop for iterating over array - [CODE STYLE]: Use
switchstatement if you have limited amount of conditions. - [NAMING]: use proper variable names in
for ofloop
BAD EXAMPLE:
for (let item of actions) {
GOOD EXAMPLE:
for (const action of actions) {
- [CODE STYLE]: switch/case should always have default case for error handling.
- [CODE STYLE]: Nested loops === EVIL
- [CODE KNOWLEDGE]: Remember, if property key is a variable - use brackets
object[key]. If it's called key - use dot accessobject.key.