hoisting/callback/Synchronous/Asynchronous


☄️ Synchronous/Asynchronous
  • Synchronous:コードを指定した順序で実行します.
    Execute the code block in order.
  • Asynchronous:コードがいつ実行されるか予測できないコード
    It doesn't execute the code block in order.
    ex - call back function
  • console.log('1');
    setTimeout(()=> {console.log('2')}, 1000);
    console.log('3');
    result : 1,3,2
    あとでもう一度呼んでくれるから呼んで.
    ☄️ Hoisting
    1. javascript is synchronous
    BUT Var, function declaration goes up and then rest of the code will be executed.
    がんばって
    JavaScriptは同期言語です.ブート後、コードは作成した順序で同期して実行されます.
    それはハウスティンとは何ですか.var変数と関数宣言は最上位に上昇し、その後コードは1つずつ実行されます.