

MCQOPTIONS
Saved Bookmarks
This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which is an equivalent code to invoke a function m of class o that expects two arguments x and y? |
A. | o(x,y); |
B. | o.m(x) && o.m(y); |
C. | m(x,y); |
D. | o.m(x,y); |
E. | |
Answer» E. | |
2. |
const ob1 = Object.create(pt1); console.log( Object.getPrototypeOf(ob1) === pt1 ); |
A. | prototype stack |
B. | prototype chain |
C. | prototype class |
D. | prototypes |
Answer» C. prototype class | |
3. |
|
A. | true |
B. | false |
C. | errot |
D. | 0 |
Answer» B. false | |
4. |
|
A. | Y=inherit(X); |
B. | Y=X.inherit(); |
C. | Y.prototype=inherit(X); |
D. | Y.prototype=inherit(X.prototype); |
Answer» D. Y.prototype=inherit(X.prototype); | |
5. |
//line 2 console.log(student.sId+" "+student.sName); |
A. | true |
B. | false |
C. | 0 |
D. | 1 |
Answer» C. 0 | |
6. |
this.from=from; this.to=to; this.pName= pName; } var ticket=new Ticket( "Udaipur","Pune","Raj" ); |
A. | var student=json.parse(json); |
B. | var student=JSON.stringify(json); |
C. | var student=JSON.parse(json); |
D. | var student=json.stringify(json); |
Answer» D. var student=json.stringify(json); | |
7. |
this.from=from; this.to=to; this.pName= pName; } var ticket=new Ticket( "Udaipur","Pune","Raj" ); |
A. | var employee=new Object(); employee.empid=20; employee.empName="John"; |
B. | var employee ={id:2001,empName:"John"}; |
C. | var employee=Employee(); employee.empid=20; employee.empName="John"; |
D. | Both A and C |
Answer» B. var employee ={id:2001,empName:"John"}; | |
8. |
constructor(h, w) { this.height = h; this.width = w; } get foo() { return this.foo(); } foo() { return this.height * this.width; } } const sq = new Rect(5, 20); console.log(sq.foo()); |
A. | ticket.from & ticket[to] |
B. | ticket[to] & ticket[from] |
C. | ticket {to} & ticket.to |
D. | ticket[to] & ticket{from} |
Answer» B. ticket[to] & ticket[from] | |