- [NAMING] - Use proper names for variables. If function was called
makeFruit
, it should returnfruit
- [CODE STYLE] - use arithmetic operators with assignment operator
=
if you want to add something to existing value
BAD EXAMPLE:
let a = 1;
a = a + 2;
GOOD EXAMPLE:
let a = 1;
a += 2;
- [CODE KNOWLEDGE] - if you creating a method in the object, you don't need to use function keyword, use shortcut instead.
BAD EXAMPLE:
methodName: function() {
// your code
},
GOOD EXAMPLE:
methodName() {
// your code
},