Answers for "difference between synchronous and asynchronous in node js"

0

difference between synchronous and asynchronous in node js

// Example 1 - Synchronous (blocks)
var result = database.query("SELECT * FROM hugetable");
console.log("Query finished");
console.log("Next line");


// Example 2 - Asynchronous (doesn't block) 
database.query("SELECT * FROM hugetable", function(result) {
    console.log("Query finished");
});
console.log("Next line");
Posted by: Guest on June-03-2020

Code answers related to "difference between synchronous and asynchronous in node js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language