Friday , September 20 2024

Analyze the code below: if (counter === 10) { console.log(“abc”); } How can we write the same condition using the switch statement?

Questions BankCategory: JavaScript Essentials 1Analyze the code below: if (counter === 10) { console.log(“abc”); } How can we write the same condition using the switch statement?
Analyze the code below:

if (counter === 10) {
    console.log("abc");
}

How can we write the same condition using the switch statement?

  • switch(counter) {case 10: console.log("abc")};
  • switch(counter) case 10: console.log("abc");
  • case(counter) {switch 10: console.log("abc")};
  • switch(counter) {case ? 10 : console.log("abc")};

More Questions: JavaScript Essentials 1 – JSE1: Module 4 Test