0

what does it do in code below?

jQuery[addClass](...);

is it same as jQuery.addClass() ?

terry
  • 301
  • 3
  • 17
  • to work properly your `addClass` must be either a string in quotes, or a variable called `addClass` that contains the name of a jQuery function. – Alnitak Sep 26 '12 at 06:51

1 Answers1

4

Yes, you can use dot notation or brackets notation:

$.show()

OR

 $['show']()

Similar question JavaScript property access: dot notation vs. brackets?

Community
  • 1
  • 1
webdeveloper
  • 17,174
  • 3
  • 48
  • 47