A developer has two ways to write a function:
Option A:
function Monster() {
This.growl = () => {
Console.log (''Grr!'');
}
}
Option B:
function Monster() {};
Monster.prototype.growl =() => {
console.log(''Grr!'');
}
After deciding on an option, the developer creates 1000 monster objects.
How many growl methods are created with Option A Option B?
A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method,
Calculator query, that returns an array. The developer does notneed to verify how many times the method has been called.
Which two test approaches describe the requirement?
Choose 2 answers
A developer implements and calls the following code when an application state change occurs:
Const onStateChange =innerPageState) => {
window.history.pushState(newPageState, ' ', null);
}
If the back button is clicked after this method is executed, what can a developer expect?
Refer to the code below:
Const resolveAfterMilliseconds = (ms) => Promise.resolve (
setTimeout ((=> console.log(ms), ms ));
Const aPromise = await resolveAfterMilliseconds(500);
Const bPromise = await resolveAfterMilliseconds(500);
Await aPromise, wait bPromise;
What is the result of running line 05?
Given the requirement to refactor the code above to JavaScript class format, which class
definition is correct?
A)
B)
C)
D)