javascript antipattern