convert javascript to coffescipt code