Ununennium
V2EX  ›  问与答

异步函数如何强制同步执行?

  •  
  •   Ununennium · Aug 30, 2020 · 1758 views
    This topic created in 2173 days ago, the information mentioned may be changed or developed.

    语言是 JavaScript 。

    强制执行顺序为 a=>b=>c 而不是 a=> b=> c=>

    谢谢!

    3 replies    2020-09-01 10:35:27 +08:00
    azh7138m
        1
    azh7138m  
       Aug 30, 2020
    缓缓打出一个?

    await a();
    await b();
    await c();

    mdn 指路 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await
    mxT52CRuqR6o5
        2
    mxT52CRuqR6o5  
       Aug 30, 2020 via Android
    学习一下 promise 、await/async,没学明白写不对的
    cwz346852114
        3
    cwz346852114  
       Sep 1, 2020
    async await
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1007 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:46 · PVG 06:46 · LAX 15:46 · JFK 18:46
    ♥ Do have faith in what you're doing.