牟田まい
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## 【第37回】JSPrimer輪読会 ###### tags: `JSPrimer輪読会` - [開催概要](https://hackmd.io/OsL28Q9fS7Wa2alu3gkoaw) - [JSPrimer輪読会 ノートまとめ](https://hackmd.io/@NRLooQz8RrqbPmaSYWZceg/r1S4p-5Ds) ------ ## 2023\-6\-22(木) ### 連絡事項や確認・相談 - ### タイムキーパー - maimu ### 読んだところ - [ES2017] Async Function の前まで ### 次回 - [ES2017] Async Function から ### 自由に使う共有スペース ### 各自の疑問点や気づき、学んだこと - まっきー - resolve(引数)で渡した引数が、その先のthenメソッドの引数内のコールバック関数の処理の中で値として使える感覚がまだ慣れていないので慣れたい - Promise.allのthenメソッドのコールバック関数の中の引数も配列になっている - Promise.raceのユースケースはとても分かりやすかった。Promise.allのユースケースも知りたい・・・ - @fuwa - `Promise.all`を使うと複数のPromiseをひとつのPromiseの配列として扱うことができる - 全てのPromiseインスタンスがFulfilledならFulfilledを、ひとつでもRejectedならRejectedを返す - `Promise.race`は複数のPromiseインスタンスの配列を受け取り、一番早くSettledになったPromiseインスタンスと同じ状態になる - maimu - `Promise.all`を使うことで複数のPromiseを使った非同期処理をひとつのPromiseとして扱うことが可能 - `Promise.race` は複数のプロミスオブジェクトを競争させて、一番早く結果が帰ってきたプロミスの処理を実行する - `startsWith()` は文字列が引数で指定された文字列で始まるかを判定して `true` か `false` を返す - dawa - Promise.allで複数のPromiseをまとめることができる。全てがFulfilledのときはFulfilledが、一つでもrejectedだとrejectedが返される。非同期はいろいろできそうですね。 - LEF - `Promise.race`で同じタイミングだと、先に書かれたコードが優先されるっぽい(?) ### 本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK) - maimu - 就活は対策よりも結果を待っている時間がメンタルを削られます😭 - 最近Pythonデビューしました! - まっきー - さいきん仕事は忙しいし自作サービスは始めてしまったし、マルウェア問題もあるし、Reactもなかなか理解進まずで色々もどかしいかんじです・・・ - SWITCHという健康本がとてもおもしろかった!←主にオートファジーのはなし - @fuwa - 就活いやだ〜〜〜〜〜〜〜〜〜 - 最近煮干しと昆布のだしを取ることにハマっているのですが、いまいち正解が見つかりません - dawa - まだクラス課題と非同期も残っていますが、みなさんの自作npmの提出ページを拝見してすごいなーと思いました。 - LEF - もうすぐインディー・ジョーンズ5が……🤠 - fuwaさんご卒業おめでとうございます🎉 - ありがとうございます〜!!! - 🎉🎉🎉 ## 2023\-6\-23(金) ### 連絡事項や確認・相談 - 6月29日はミートアップのため、輪読会はお休みです! - 卒業式、きてください〜!! ### タイムキーパー - maimu ### 読んだところ - await式はAsync Functionの直下でのみ利用可能 の前まで ### 次回 - await式はAsync Functionの直下でのみ利用可能 から ### 自由に使う共有スペース ### 各自の疑問点や気づき、学んだこと - まっきー - awaitは式に付けられることに注意。await Promiseインスタンスだったり、await Promise.allだったり - Async関数には3つのパターンがある(値を返す場合、Promiseを返す場合、例外が発生する場合) - 今日はすんなりコードも理解できた(気がする)のはこれまでのPromiseの仕様を苦労して学んできた土台あってこそだと感じた。継続は力なり💪 - haruguchi - 本編で言わなかったこと > このAsync Functionは次のように書いた場合と同じ意味になります。 Async Functionではreturnした値の代わりに、Promise.resolve(返り値)のように返り値をラップしたPromiseインスタンスを返します。 とあるのですが、実は同じじゃないです。JS Primerは初学者向けの書籍なので特に修正は入りませんでした。興味あれば以下の記事を https://zenn.dev/uhyo/articles/return-await-promise - ループ(Array.prototypeの関数)でPromiseを使うと結構ハマりポイントが多い。辛い。 - maimu - `Async` 関数は必ずPromiseを返す - `Async`関数内では`await`式が利用可能 - ECMAScriptモジュールの直下でも`await` 式は利用が可能 - `Async` 関数内だと`await` 式が使えるので反復処理も書きやすい - `await`式がエラーを`throw`するということは、そのエラーは`try...catch`構文でキャッチすることが可能 - 通常の非同期処理では完了する前に次の行が実行されてしまうため`try...catch`構文ではエラーをキャッチできない - dawa - await式はエラーをthrowするのでtry…catch構文が使える。 - await式とthenを使った式ではawait式のほうがネストが減るかつ同期的に書けるので見やすくなる。 - umizaru(話せます) - Async FunctionはPromiseをベースにしており、Async Functionとして定義した関数は必ずPromiseを返す。 - Asyncの中でしかawaitは定義できず、awaitはPtomiseインスタンスがResolveかRejectになるまで非同期処理の完了を待つ。 - await式で発生したエラーをtry..catch構文でキャッチできる。 ### 本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK) - dawa - 今日非同期処理のプラクティスに合格しました。エラーの制御がわかっていなくていろいろと指摘していただきました。 - :tada: - あとで梅本さんのコメント読みにいきます! - まっきー - 明日はumizaruさん企画のもくもく会なので楽しみです〜!!!実はおやつタイムが楽しみだったりします笑🍭🍫🍦 - 楽しそう〜!飛行機で行きます!冗談です。 - 自転車で来れますよ!!!今夜出発すれば・・・ :gogo: 琵琶湖2周半くらいでいける - umizaru - ↑↑自分ももくもく会、とても楽しみにしてます〜! - 今週から5時起きの朝活スタイルに切り替えたらとても良い感じです!3週間続けて習慣にしたい〜〜 - 5時起きできれば独習Railsの輪読会にも参加できますね! - たしかに!JSにハマりすぎてRailsもう覚えてないですw(笑ってる場合ではない) - 5時起きとか早すぎて自分には無理ですが、FBCにはすごい方たくさんいますね。 - haruguchi - 仕事でRubyの非同期処理が必要になるかもしれないくてとてもタイムリーでした。RactorはどうやらActive Recordと噛み合わせが悪いらしくてプロセス生成して管理してくれる`parallel gem`を使うみたい。 - maimu - 豆大福が買えなかったのでドンレミーのロールケーキの切れ端パックを買っておやつに食べました😋 - 欲しい技術書がありすぎてどんな順番で買うか迷います

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully