Home » JavaScript » JavaScript Functions » Question
  1. Which is an equivalent code to invoke a function fun of class opt that expects two arguments p and q?
    1. opt.fun(p,q);
    2. fun(p,q);
    3. opt.fun(p) && opt.fun(q);
    4. opt(p,q);
    5. None of these
Correct Option: A

The two argument in a function are separated by a comma (,). The code above is an invocation expression: it includes a function expression opt.fun and two argument expressions, p and q.



Your comments will be displayed only after manual approval.