MultipleChoice
Refer to the following code:
01 function Tiger(){
02 this.Type = 'Cat';
03 this.size = 'large';
04 }
05
06 let tony = new Tiger();
07 tony.roar = () =>{
08 console.log('They\'re great1');
09 };
10
11 function Lion(){
12 this.type = 'Cat';
13 this.size = 'large';
14 }
15
16 let leo = new Lion();
17 //Insert code here
18 leo.roar();
Which two statements could be inserted at line 17 to enable the function call on line 18?
Choose 2 answers.
OptionsMultipleChoice
At Universal Containers, every team has its own way of copying JavaScript objects. The
code
Snippet shows an implementation from one team:
Function Person() {
this.firstName = ''John'';
this.lastName = 'Doe';
This.name =() => (
console.log('Hello $(this.firstName) $(this.firstName)');
)}
Const john = new Person ();
Const dan = JSON.parse(JSON.stringify(john));
dan.firstName ='Dan';
dan.name();
What is the Output of the code execution?
OptionsMultipleChoice
A developer is required to write a function that calculates the sum of elements in an
array but is getting undefined every time the code is executed. The developer needs to find
what is missing in the code below.
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
//
Result += current;
//
), 10);
);
Which option makes the code work as expected?
OptionsMultipleChoice
developer removes the HTML class attribute from the checkout button, so now it is
simply:
<button>Checkout</button>.
There is a test to verify the existence of the checkout button, however it looks for a button with
class= ''blue''. The test fails because no such button is found.
Which type of test category describes this test?
OptionsMultipleChoice
Refer to the HTML below:
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
Which JavaScript statement results in changing '' Tony'' to ''Mr. T.''?
OptionsMultipleChoice
Refer to the code below:
let sayHello = () => {
console.log ('Hello, world!');
};
Which code executes sayHello once, two minutes from now?
OptionsMultipleChoice
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++)
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of array after the code executes?
OptionsMultipleChoice
Refer to HTML below:
The current status of an Order: <span id =''status''> In Progress </span>
.Which JavaScript statement changes the text 'In Progress' to 'Completed' ?
OptionsMultipleChoice
Given the following code:
document.body.addEventListener(' click ', (event) => {
if (/* CODE REPLACEMENT HERE */) {
console.log('button clicked!');
)
});
Which replacement for the conditional statement on line 02 allows a developer to
correctly determine that a button on page is clicked?
OptionsMultipleChoice
Refer to code below:
function Person() {
this.firstName = 'John';
}
Person.prototype ={
Job: x => 'Developer'
};
const myFather = new Person();
const result =myFather.firstName + ' ' + myFather.job();
What is the value of the result after line 10 executes?
Options