What keyword is used to define class member that are referenced on the class directly rather than on instances of the class?
protected
static
extends
implements
Is super() required in child's class even if it doesn't implement constructor?
super()
yes
no
What will the following code output to the console?
class Parent { constructor() { console.log("created"); } } class Child extends Parent {} var a = new Child()
created
nothing
throw an error
class Car { constructor() { console.log("created"); } } var car = new Car();
Which of the following function should be executed to reject a promise?
var x = new Promise(function (a, b) { });
a
b
Which of the following function should be executed to resolve a promise?
Promise is in one of 3 states. Which one?
ready
pending
rejected
progress
fulfilled
The Promise represents:
the function declaration with the specified parameters
a constructor that creates a new generator function object
a shorter syntax for a function expression
the eventual completion or failure of an asynchronous operation
let isAsync = false; function doAsync() { return new Promise(function (resolve, reject) { resolve(); }); } doAsync() .then(function (val) { console.log(isAsync); }); isAsync = true;
true
false
function doAsync() { return new Promise(function (resolve, reject) { reject(); }); } doAsync() .then(function () { console.log(true); }) .catch(function () { console.log(false); });
true and then false
false and then true