Warning: Attempt to read property "ID" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 471

Warning: Attempt to read property "display_name" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 480

Warning: Attempt to read property "display_name" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 487

Warning: Attempt to read property "description" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 489

Warning: Attempt to read property "ID" on bool in /www/wwwroot/129.28.78.18/wp-content/themes/storeys-pro/wbc/components/og_schema/wb_og_schema.php on line 493

继续深入理解Node.js的回调机制(三个函数相互调用关系)

我们在js里普通函数的执行顺序如下:

定义了三个函数,myFirstFun()的返回值,赋值给mySecondFun(),myLastFun()函数,调用了mySecondFun()构成了一个相互传递的过程
即:
A-->B-->C,C输出。这是一种顺序,逻辑关系。
那么在Node.js里就完全不一样了,因为是异步的关系,所以写起来就非常麻烦。
不过Node.js提供了一个async框架,可以完全解决这个问题。

评论留言