Rewrite JavaScript to CoffeeScript