add javascript best practice