Which of the following is the correct program code that repeatedly calls a function after every two seconds for continuous eight seconds. and after that clears the interval with the message "Loop ends" and exits the application?
Correct Answer:
var count = 0;
var obj1 =setlnterval(function(){
count++;
console.log(count, '2 seconds has passed‘);
if(count = 4) [
console.log('Loop ends');
clearlnterval(obj1); ]
},2000);
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Node.js MCQ Questions