d4rklit3 d4rklit3 - 1 year ago 129
Javascript Question

CoffeeScript, pass multiple parameters including an anonymous function

I am not sure how to write this in CS. maybe some1 can help:

FB.getLoginStatus(function (response) {} , {scope : scope})


Answer Source

You would write some CoffeeScript like so...

  (response) -> 
  {scope: scope})

Which would convert to the JavaScript like so...

FB.getLoginStatus(function(response) {
  return doSomething();
}, {
  scope: scope
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download