What is the difference between synchronous and asynchronous programming (in node.js)

前端 未结 10 1609
情歌与酒
情歌与酒 2020-11-22 01:49

I\'ve been reading nodebeginner And I came across the following two pieces of code.

The first one:

    var result = database.query(\"SELECT * FROM hu         


        
10条回答
  •  萌比男神i
    2020-11-22 02:31

    The main difference is with asynchronous programming, you don't stop execution otherwise. You can continue executing other code while the 'request' is being made.

提交回复
热议问题