1

How do I write this in coffee script?

function setUpDialogForms() {
    setUpListForm();
    setUpUpdateForm();
}

I have tried

setUpDialogForms -> setUpListForm(); setUpUpdateForm()
1
  • You've got already correct answer here, but this link might be useful in such situations. Here you go: js2coffee.org Commented Sep 17, 2012 at 16:51

2 Answers 2

4

Provided the setUpListForm and setUpUpdateForm functions are defined somewhere, you can use:

setUpDialogForms = ->
  setUpListForm()
  setUpUpdateForm()

setUpDialogForms()
Sign up to request clarification or add additional context in comments.

1 Comment

This is the more coffeescript-ish answer, e.g. no () for function params, and not forcing the null return.
1

Found it out.

setUpDialogForms = () -> 
    setUpListForm() 
    setUpUpdateForm()
    return

Which returns

var setUpDialogForms;

setUpDialogForms = function() {
  setUpListForm();
  setUpUpdateForm();
};

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.