JS Coding Questions Logo
JS Coding Questions
#50🎯 Exercise💻 Code

JavaScript Coding Exercise 50

Advertisement

728x90
javascript
1function Person() {}
2
3Person.prototype.walk = function () {
4
5return this;
6};
7
8Person.run = function () {
9
10return this;
11};
12
13let user = new Person();
14
15let walk = user.walk;
16
17console.log(walk());
18
19let run = Person.run;
20
21console.log(run());

Choose the correct output:

A
undefined, undefined
B
Person, Person
C
SyntaxError
D
Window, Window

Advertisement

Responsive Ad
49of86