When writing asynchronous code, it is possible to create subtle race condition bugs. Consider the following example:
Comparing to null
without a type-checking operator (===
or !==
), can have unintended results as the comparison will evaluate to true
when comparing to not just a null
, but also an undefined
value.
When writing TypeScript applications, it's safe to store literal values on classes using fields with the readonly
modifier to prevent them from being reassigned.
Arrow functions should not be used in computed properties because they are unable to access other properties (using this.property
) of the same object. Accidental usage can thus lead to bugs.
.on()
JS-0800Avoid using .on()
in favour of component's lifecycle hooks. The order of execution for on()
is not deterministic.