×ðÁú¿­Ê±¹ÙÍøµÇ¼

jsÖÐʲôʱ¼äʹÓûص÷º¯Êý

»Øµ÷º¯ÊýÓÃÓÚÔÚÌض¨ÊÂÎñ±¬·¢ºóÖ´ÐдúÂë £¬ÓÈÆäÊÊÓÃÓÚÒì²½²Ù×÷ £¬ÈçÒì²½ i/o¡¢¼ÆʱÆ÷¡¢ÊÂÎñ¼àÌýÆ÷ºÍ promise/async/await µÄ´¦Àí¡ £»Øµ÷º¯ÊýµÄÓÅÊÆ°üÀ¨·ÇÛÕ±Õ¡¢ÊÂÎñÇý¶¯ºÍÎÞаÐÔ¡£ÐèҪעÖصÄÊÇ £¬¹ý¶àǶÌ׵Ļص÷º¯Êý»áµ¼Ö¡°»Øµ÷µØÓü¡± £¬Òò´Ë½¨ÒéʹÓà promise »ò async/await À´×èÖ¹´ËÎÊÌ⡣ͬʱ £¬»¹Ðè˼Á¿¹ýʧ´¦ÀíºÍÖÎÀíÒì²½²¢·¢µÄÇéÐΡ£

JavaScript »Øµ÷º¯ÊýµÄʹÓÃʱ»ú

»Øµ÷º¯ÊýÊÇÒ»ÖÖÔÚÖ¸¶¨µÄÊÂÎñ±¬·¢ºóÖ´Ðеĺ¯Êý¡£ËüÔÚ JavaScript Öо­³£ÓÃÓÚÒì²½²Ù×÷ £¬Ò²¾ÍÊDz»»áÁ¬Ã¦·µ»ØЧ¹ûµÄ²Ù×÷¡£

ʲôʱ¼äʹÓûص÷º¯Êý£¿

µ±ÐèÒªÔÚij¸ö²Ù×÷Íê³ÉºóÖ´ÐдúÂëʱ £¬¿ÉÒÔʹÓûص÷º¯Êý¡£³£¼ûµÄ³¡¾°°üÀ¨£º

Òì²½ I/O ²Ù×÷£º¶ÁÈ¡»òдÈëÎļþ¡¢·¢ËÍÍøÂçÇëÇóµÈ²Ù×÷²»»áÁ¬Ã¦·µ»ØЧ¹û¡£¿ÉÒÔͨ¹ý»Øµ÷º¯ÊýÀ´ÎüÊÕ²Ù×÷Íê³ÉºóµÄЧ¹û¡£

¼ÆʱÆ÷£º setTimeout() ºÍ setInterval() º¯ÊýÔÊÐíÖ¸¶¨Ò»¶Îʱ¼äºóÖ´ÐдúÂë¡ £»Øµ÷º¯Êý¿ÉÒÔÓÃÀ´´¦Àí¼ÆʱÆ÷µ½ÆÚºóµÄ²Ù×÷¡£

ÊÂÎñ¼àÌýÆ÷£º DOM ÊÂÎñ£¨ÀýÈçµã»÷¡¢Ìá½»£©¿ÉÒÔ¸½¼ÓÊÂÎñ¼àÌýÆ÷¡ £»Øµ÷º¯Êý½«ÔÚÊÂÎñ±¬·¢Ê±±»´¥·¢¡£

Promise ºÍ Async/Await£º ÕâЩÊÇ´¦ÀíÒì²½²Ù×÷µÄÏÖ´ú JavaScript ÒªÁì¡£ËüÃǶ¼Ê¹Óûص÷º¯ÊýÀ´´¦ÀíÀֳɻòʧ°ÜµÄЧ¹û¡£

ʹÓûص÷º¯ÊýµÄÓÅÊÆ£º

·ÇÛÕ±Õ£º »Øµ÷º¯ÊýÔÊÐíÔÚÖ´ÐÐÒì²½²Ù×÷ʱ¼ÌÐøÖ´ÐÐÆäËû´úÂë £¬´Ó¶øÌá¸ß´úÂëµÄÐÔÄÜ¡£

ÊÂÎñÇý¶¯£º »Øµ÷º¯ÊýÔÚÌض¨µÄÊÂÎñ±¬·¢ºó´¥·¢ £¬ÓÐÖúÓÚ¼á³Ö´úÂëµÄÓÐÐòÐԺͿÉά»¤ÐÔ¡£

ÎÞаÐÔ£º »Øµ÷º¯Êý¿ÉÒÔ½ÓÊܲî±ðµÄ²ÎÊý £¬Æ¾Ö¤²Ù×÷µÄЧ¹ûÖ´Ðвî±ðµÄ´úÂë¡£

ʹÓûص÷º¯ÊýµÄ×¢ÖØÊÂÏ

»Øµ÷µØÓü£º ǶÌ×¹ý¶àµÄ»Øµ÷º¯Êý»áµ¼Ö´úÂëÄÑÒÔÃ÷È·ºÍµ÷ÊÔ¡£ÍƼöʹÓà Promise »ò Async/Await À´×èÖ¹Õâ¸öÎÊÌâ¡£

¹ýʧ´¦Àí£º Òì²½²Ù×÷¿ÉÄÜ»áʧ°Ü £¬Òò´ËÐèÒªÔڻص÷º¯ÊýÖжԹýʧ¾ÙÐÐÊʵ±µÄ´¦Àí¡£

Òì²½²¢·¢£º ͬʱ±¬·¢µÄÒì²½²Ù×÷¿ÉÄܻᵼÖ¾ºÕùÌõ¼þºÍÒâÍâÐÐΪ¡£ÐèҪʹÓÃËø»òÆäËûÊÖÒÕÀ´ÖÎÀíÒì²½²¢·¢¡£

ÒÔÉϾÍÊÇjsÖÐʲôʱ¼äʹÓûص÷º¯ÊýµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ