Free Certified JavaScript Developer I Exam Braindumps
Salesforce Certified JavaScript Developer I Questions 81–85 (page: 18)

Updated On: 10-Feb-2026

A developer has code that calculates a restaurant bill, but generates incorrect answers while testing the code:
function calculateBill (items ) {
let total = 0;
total += findSubTotal(items);
total += addTax(total);
total += addTip(total);
return total;
}
Which option allows the developer to step into each function execution within calculateBill?

  1. Using the debugger command on line 05.
  2. Using the debugger command on line 03
  3. Calling the console.trace (total) method on line 03.
  4. Wrapping findSubtotal in a console.log() method.

Answer(s): A



The developer has a function that prints "Hello" to an input name. To test this,thedeveloper created a function that returns "World". However the following snippet does not print " Hello World".



What can the developer do to change the code to print "Hello World" ?

  1. Change line 7 to ) () ;
  2. Change line 2 to console.log(`Hello' ,name() );
  3. Change line 9 to sayHello(world) ();
  4. Change line 5 to function world ( ) {

Answer(s): B



A developer has the function, shown below, that is called when a page loads.
function onload() {
console.log("Page has loaded!");
}
Where can the developer see the log statement after loading the page in the browser?

  1. Terminal running the web server.
  2. Browser performance toots
  3. Browser javaScript console
  4. On the webpage.

Answer(s): C



Refer to the code below:
letsayHello = () => {
console.log (`Hello, world!');
};
Which code executes sayHello once, two minutes from now?

  1. setTimeout(sayHello, 12000);
  2. setInterval(sayHello, 12000);
  3. setTimeout(sayHello(), 12000);
  4. delay(sayHello, 12000);

Answer(s): A



What is the result of the code block?

  1. The console logs only `flag'.
  2. The console logs `flag' and another flag.
  3. An error is thrown.
  4. The console logs `flag' and then an error is thrown.

Answer(s): A



Viewing page 18 of 46
Viewing questions 86 - 90 out of 224 questions


Post your Comments and Discuss Salesforce Certified JavaScript Developer I exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!