Add JavaScript implementation