Most common rules.
Use 2 spaces
Use single quotes for string unless escaping is necessary.
let str = 'my string';
Use space after keywords if for while and
around operators = + -...
if (true) {
// code
}
Use named function expression instead of function declaration. Give the variable a short name and the function a longer more descriptive name.
// bad
function addEntry() {
//code
}
// good
const addEntry = function addNewEntryToArray() {
// code
}