View Mode
Q: 11
Code: 01 let array = [1, 2, 3, 4, 4, 5, 4, 4]; 02 for (let i = 0; i < array.length; i++) { 03 if (array[i] === 4) { 04 array.splice(i, 1); 05 i--; 06 } 07 } What is the value of array after execution?
Options
Q: 12
A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging. 01 function Car(maxSpeed, color) { 02 this.maxSpeed = maxSpeed; 03 this.color = color; 04 } 05 let carSpeed = document.getElementById('carSpeed'); 06 debugger; 07 let fourWheels = new Car(carSpeed.value, 'red'); When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console?
Options
Q: 13
Original code: 01 let requestPromise = client.getRequest; 03 requestPromise().then((response) => { 04 handleResponse(response); 05 }); The developer wants to gracefully handle errors from a Promise-based GET request. Which code modification is correct?
Options
Q: 14
Code: 01 const sayHello = (name) => { 02 console.log('Hello ', name); 03 }; 04 05 const world = () => { 06 return 'World'; 07 }; 08 09 sayHello(world); This does not print "Hello World". What change is needed?
Options
Q: 15
Which two implementations of utils.js support foo and bar?
Options
Q: 16
Refer to the code below: 01 let timedFunction = () => { 02 console.log('Timer called.'); 03 }; 04 05 let timerId = setInterval(timedFunction, 1000); Which statement allows a developer to cancel the scheduled timed function?
Options
Q: 17
A Node.js server library uses events and callbacks. The developer wants to log any issues the server has at boot time. Which code logs an error with an event?
Options
Q: 18
Which option is true about the strict mode in imported modules?
Options
Q: 19
A developer is creating a simple webpage with a button. When a user clicks this button for the first time, a message is displayed. The developer wrote the JavaScript code below, but something is missing. The message gets displayed every time a user clicks the button, instead of just the first time. 01 function listen(event) { 02 03 alert('Hey! I am John Doe'); 04 05 } 06 button.addEventListener('click', listen); Which two code lines make this code work as required?
Options
Q: 20
Refer to the code: const pi = 3.1415926; What is the data type of pi?
Options
Question 11 of 20 · Page 2 / 2

Premium Access Includes

  • ✓ Quiz Simulator
  • ✓ Exam Mode
  • ✓ Progress Tracking
  • ✓ Question Saving
  • ✓ Flash Cards
  • ✓ Drag & Drops
  • ✓ 3 Months Access
  • ✓ PDF Downloads
Get Premium Access
Scroll to Top

FLASH OFFER

Days
Hours
Minutes
Seconds

avail 10% DISCOUNT on YOUR PURCHASE