MCQs > IT & Programming > Node.js > Carefully study the following code snippet and answer the question that follows: new_function (true, function (data){ func1(); }); func2(); function func1(){console.log('Clouds')} function func2(){console.log('Sunshine')} function new_function (ar1, ar2) { if (ar1) { ??? } else { setTimeout(function () { ar2() }, 1000); } } Which of the given code lines should be written in place of '???' in the above program so that the following output is obtained?

Node.js MCQs

Carefully study the following code snippet and answer the question that follows:

new_function (true, function (data){

func1(); });

func2();

function func1(){console.log("Clouds")}

function func2(){console.log("Sunshine")}

function new_function (ar1, ar2) {

if (ar1) {

???

}

else {

setTimeout(function () {

ar2()

}, 1000);

} }

Which of the given code lines should be written in place of "???" in the above program so that the following output is obtained?

Answer

Correct Answer:

process.nextTick(function () {

ar2();

});  


Explanation:

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

More Node.js MCQ Questions

search

Node.js Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it