ExamGecko
Ask Question

Salesforce Certified JavaScript Developer I Practice Test - Questions Answers, Page 10

Add to Whishlist

List of questions

Question 91

Report Export Collapse

Given the code below: const copy = JSON.stringify([ new String(' false '), new Bollean( false ), undefined ]); What is the value of copy?

Become a Premium Member for full access
  Unlock Premium Member

Question 92

Report Export Collapse

The developer wants to test the array shown: const arr = Array(5).fill(0) Which two tests are the most accurate for this array ?

Choose 2 answers:

Become a Premium Member for full access
  Unlock Premium Member

Question 93

Report Export Collapse

A developer receives a comment from the Tech Lead that the code given below has error:

error:

const monthName = 'July';

const year = 2019;

if(year === 2019) {

monthName = 'June';

Which line edit should be made to make this code run?

Become a Premium Member for full access
  Unlock Premium Member

Question 94

Report Export Collapse

Refer to the following code:

<html lang="en">

<body>

<div onclick = "console.log('Outer message') ;">

<button id ="myButton">CLick me<button>

</div>

</body>

<script>

function displayMessage(ev) {

ev.stopPropagation();

console.log('Inner message.');

}

const elem = document.getElementById('myButton');

elem.addEventListener('click' , displayMessage);

</script>

</html> What will the console show when the button is clicked?

Become a Premium Member for full access
  Unlock Premium Member

Question 95

Report Export Collapse

Refer to the code below: function foo () { const a =2; function bat() { console.log(a);

} return bar;

} Why does the function bar have access to variable a ?

Become a Premium Member for full access
  Unlock Premium Member

Question 96

Report Export Collapse

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?

Become a Premium Member for full access
  Unlock Premium Member

Question 97

Report Export Collapse

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?

Become a Premium Member for full access
  Unlock Premium Member

Question 98

Report Export Collapse

Universal Container(UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions that cause this problem. To verify this, the developer decides to do everything and log the time each of these three suspicious functions consumes.

console.time('Performance');

maybeAHeavyFunction();

thisCouldTakeTooLong();

orMaybeThisOne();

console.endTime('Performance');

Which function can the developer use to obtain the time spent by every one of the three functions?

Become a Premium Member for full access
  Unlock Premium Member

Question 99

Report Export Collapse

Refer to the code below:

console.log(''start);

Promise.resolve('Success') .then(function(value){

console.log('Success');

});

console.log('End');

What is the output after the code executes successfully?

Become a Premium Member for full access
  Unlock Premium Member

Question 100

Report Export Collapse

Refer to HTML below:

<div id ="main">

<div id = " card-00">This card is smaller.</div>

<div id = "card-01">The width and height of this card is determined by its contents.</div>

</div> Which expression outputs the screen width of the element with the ID card-01?

Become a Premium Member for full access
  Unlock Premium Member
Total 224 questions
Go to page: of 23
Search

Related questions