JavaScript-Developer-I Exam Question 11

Refer of the string below:
Const str = 'sa;esforce'=;
Which two statement result in the word 'Sale'?
Choose 2 answers
  • JavaScript-Developer-I Exam Question 12

    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?
  • JavaScript-Developer-I Exam Question 13

    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 alert ( 'Hey! I am John Doe') ;
    03 button.addEventListener ('click', listen);
    Which two code lines make this code work as required?
    Choose 2 answers
  • JavaScript-Developer-I Exam Question 14

    Given the code below:
    Function myFunction(){
    A =5;
    Var b =1;
    }
    myFunction();
    console.log(a);
    console.log(b);
    What is the expected output?
  • JavaScript-Developer-I Exam Question 15

    Given the following code:
    Counter = 0;
    const logCounter = () => {
    console.log(counter);
    );
    logCounter();
    setTimeout(logCOunter, 1100);
    setInterval(() => {
    Counter++
    logCounter();
    }, 1000);
    What is logged by the first four log statements?