converted JavaScript.js to coffee