TODO This section is a stub and needs to be improved.
The ESLint rules will catch most of the style issues, so you might just want to
furipota run lint on your code. That said, there are a few idioms that aren’t
captured by ESLint rules:
constfor declaring names wherever possible. When a name or the value it refers to is mutated in the scope, use
letinstead. In this sense, we use
constto indicate an immutable binding and value, and
letfor everything else.
.prototype. So, if you’re not writing a method, where you’ll want
this, it should be an arrow function.
Use Lisp/Haskell-alignment for conditionals when using ternaries. For example:
return argCount < arity ? curried(allArgs) : argCount === arity ? fn(...allArgs) : /* otherwise */ unrollInvoke(fn, arity, allArgs);
The comment for the last
elsecase is not optional, but can be shortened to
/* else */for shorter conditions.