• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

I think I am going to cry

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #91
    And as an alternative to a whole anonymous class in Java they are a considerable improvement.
    While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

    Comment


      #92
      Originally posted by Bunk View Post
      I also think it's more readable to have the anonymous function which is called when the event is triggered, and inside it you can call any functions you want.

      I don't like:

      Code:
      element.addEventListener('click', toggleMenu.bind(null, param1, param2), false);
      I prefer:

      Code:
      element.addEventListener('click', function() {
          toggleMenu(param1, param2);
      }, false);
      Personal preference, but I won't be changing how I do it anytime soon. Or at least until I see a better argument against it.
      Suity says.
      Knock first as I might be balancing my chakras.

      Comment

      Working...
      X