Use temporary variables.
Report errors (or not).
Remove unused properties declarations.
Clarify documentation.
Wrap ternaries in parenthesis.