Test Question Object Oriented Programming

Is the following code valid? class Person { constructor(name, age) { = name; this.age = age; } } const person = new Person('John', 20); console.log(; console.log(person.age);


If class B inherits from class A and if class C inherits from class B then does class C inherit from A ?

Author: Eric HostaleryStatus : PublishedQuestion answered 1,266 times
Reviews from developersNo one has evaluated this question yet - be the first!
Your browser is badly|not supported!
We recommend you to use a more modern browser such as Edge, Chrome or Firefox
Know More