JS patterns, anti-patterns & optimisation techniques