ブックマーク / uhyohyo.net (1)

  • 十六章第五回 Promise — JavaScript初級者から中級者になろう — uhyohyo.net

    十六章第五回 Promiseこのページの最終更新日:2017年11月8日 今回はES2015で追加されたPromiseを解説します。Promiseは、簡単にいうと非同期処理を抽象化したオブジェクトです。 従来の非同期処理非同期処理というのはおおざっぱに言えばすぐには結果が得られない処理です。今までにもいくつかの例を紹介しました。例えば、XMLHttpRequestです。これは、次のように使いました。 const xhr=new XMLHttpRequest(); xhr.open("GET","/index.html"); xhr.send(null); xhr.addEventListener("load",function(e){ console.log(xhr.status, xhr.responseText); }); これは非常に単純なコードで、/index.htmlをGETで読

    十六章第五回 Promise — JavaScript初級者から中級者になろう — uhyohyo.net
    kita-tuba
    kita-tuba 2017/04/13
    十六章第五回 Promise — JavaScript初級者から中級者になろう — uhyohyo.net
  • 1