What will be the equivalent code of the following JavaScript code? [code] o.m(x,y); [/code]

Stasenndb

New member
What will be the equivalent code of the following JavaScript code?
Code:
o.m(x,y);
A. o.m(x) && o.m(y);
B. o[“m”](x,y);
C. o(m)[“x”,”y”];
D. o.m(x && y);
 
Answer: b
Explanation: Another way to write o.m(x,y) is o[“m”](x,y).o[“m”] will access the property of the object and parenthesis will access the function present inside it.
 

Tìm kiếm

Back
Top