-3

I found the following pattern but i'm not sure how to call this one.

test(var1, {
    subTest1: test1Function(function(var2) {
        // elided
    }),
    subTest2: test2Function(html) {
        // elided
    }
});

I need to call subTest1, how can I do this? Can anyone help me?

Refferance:Javascript page link(Line-10975)

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92

1 Answers1

1

From jquery i have found out that the extend is a high level function that copies the prototype of a new subclass that you want to extend from the base class,to call subTest1 you will do it like a normal method obj1.subTest1(var2)

The corect sintax is

extend(obj1, {
   subTest1: test1Function(function(var2) {
    .
    .
   }),
  subTest2: test2Function(html) {
    .
    .
   })
});
madalinivascu
  • 32,064
  • 4
  • 39
  • 55