Exam4Training

Which code executes sayHello once, two minutes from now?

Refer to the code below:

let sayHello = () => {

console.log (‘Hello, world!’);

};

Which code executes sayHello once, two minutes from now?
A . setTimeout(sayHello, 12000);
B . setInterval(sayHello, 12000);
C . setTimeout(sayHello(), 12000);
D . delay(sayHello, 12000);

Answer: A

Exit mobile version