One of the very first sections of the coffee script documentation is how to declare functions. You don't just change the word function
to ->
. It's not that simple. In Javascript functions are function(args) { body }
, but in Coffee Script it's (args) -> body
But for brevity, when you have this:
Spotify.login(username, password, function (err, spotify)) {
That's not going to work CoffeeScript, because that's not the syntax for declaring functions. You want:
Spotify.login username, password, (err, spotify) ->
# function body
And the same here:
spotify.get(uri, function(err, track){
Which should be:
spotify.get uri, (err, track) ->