牟田まい
    • 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
    ## 【第34回】JSPrimer輪読会 ###### tags: `JSPrimer輪読会` - [開催概要](https://hackmd.io/OsL28Q9fS7Wa2alu3gkoaw) - [JSPrimer輪読会 ノートまとめ](https://hackmd.io/@NRLooQz8RrqbPmaSYWZceg/r1S4p-5Ds) ------ ## 2023\-6\-1(木) ### 連絡事項や確認・相談 - ### タイムキーパー - maimu ### 読んだところ - 非同期処理 の前まで ### 次回 - 非同期処理 から ### 自由に使う共有スペース ### 各自の疑問点や気づき、学んだこと - maimu - `throw` 文はあらゆるオブジェクトを例外として投げられる - 文字列とかも渡せる - 基本的にErrorオブジェクトのインスタンスを投げることを推奨されている - スタックトレースがえられなくなってしまうため - SyntaxErrorは、実行時のエラーをキャッチする`try...catch`文ではcatchできない - 同期処理の間?に重い処理があり、次の処理が実行できないことをブロッキングという - @fuwa - `console.error`でメッセージとスタックトレースをコンソールに出力できるのでべんり - 非同期処理まだちゃんとわかっていないのでがんばろうと思います - まっきー - eval関数でParse時のエラーを無理やりランタイムエラーにできるテクニック - JavaScriptはシングルスレッド?? - https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide/In_depth ここら辺読むと理解できるかも? - 🙌 読んでみます! - この章は非同期処理プラクティスのときに一度ひとりで読んだのに結局非同期処理が何のためにあるのかピンとこなかった、のでしっかりここで学びたい - @haruguchi - JSの組み込みのerrorオブジェクト何があるかあんまり知らないや - dawa - 同期処理はひとつの処理が終わるまで次の処理は行わず、非同期処理では複数の処理を同時に行える。 - ### 本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK) - @fuwa - ほとんど電話で聞けなかった。。 - 就活に備えてこれから美容院に行ってきます。なんと半年ぶり - まっきー - さいきんOKストアで売られるようになったA2ミルクを毎週爆買いして爆飲みしています - maimu - そろそろ読みます詐欺を続けているパダワンさんのZENNを読む時かもしれない・・・(非同期と仲良くなりたい) - YouTubeとChatGPTがあると数学の勉強が捗ります! - dawa - オライリーのJavaScript第7版という本を買ってみました。分厚くて文章が多いです。 - 自分も持ってます!🦏 - 積んでます。。 - LEF(代読お願いします) - 咳が治まるまで就活を完全にストップしていて、ヒマジンに…… - 謎の八頭身ピヨルドさん - https://twitter.com/komagata/status/1663489834718228480?s=20 - 叔父さんからファミコンを貰いました🎮 - 新しく出版されるオライリーのTypeScript本が気になっています。 - [O'Reilly Japan - 初めてのTypeScript](https://www.oreilly.co.jp/books/9784814400362/?utm_source=feed&utm_mediun=referral&utm_content=new_book) - +1 - 後半にある型パズル気になる - haruguchi - Rubyのハッシュがわからん。データ構造に詳しい方おられぬか? - 梅本さん・・・? - Ruby のしくみに書いてありますよ、たしか   - 何!?挿入時の計算量が知りたいO(1)って書いてあるのになんか遅い時があって、、、 - ハッシュ値と、ハッシュ値ごとの連結リストがあったはずなので、連結リストの挿入に時間がかかってるのかもしれませんね。どんな連結リストが使われていたかは分からないですが...。取得は O(1) だと思いますが、挿入はどうなんでしょう? いやほんとうかな... 何か見た時は参照,削除,挿入O(1)って書いてあった気がするけど、ちょっと確かめるところからですね。 ## 2023\-6\-2(金) ### 連絡事項や確認・相談 - ### タイムキーパー - maimu ### 読んだところ - Promiseインスタンスの作成 の前まで ### 次回 - Promiseインスタンスの作成 から ### 自由に使う共有スペース ```javascript! function asyncf() { return new Promise((resolve, reject) => { if (Math.random() > 0.5) { resolve('なんかの値') } else { reject(new Error('失敗の理由')) } }) } asyncf() .then((value) => console.log(value)) // 成功時はvalueに解決値が入る(resolveに渡した引数) .catch((error) => console.error(error)) // 失敗時にはエラー理由が入る ``` ### 各自の疑問点や気づき、学んだこと - まっきー - JavaScript自体はシングルスレッドだけど、ブラウザでWeb Worker APIを使えばマルチスレッドにできる - Reactでさんざんコールバック関数を書かされたおかげ?か、コールバック関数の処理がだいぶ読みやすくなった気がする。成長?! - 非同期処理の外から例外を知るための方法として、PromiseとAsync関数は生まれたことを知れて面白かった - どっちかというとcallback hellが嫌すぎて作ったような気が、、、(不確実) - やっぱりそうなんですね(笑)コールバック地獄・・ - maimu - JSはシングルスレッドなため、ブラウザで`setTimeout` が登録された際などは、ブラウザの環境で秒数のカウントが行われ、同期処理が完了した後に非同期処理が実行される - 同期処理の間に非同期処理が挟まれることはない - 同期処理でブロッキングが発生すると非同期処理の実行自体が遅れる場合もある - `Promise`はいまいちわかってないので復習します・・・ - umizaru - 非同期処理は必ず同期処理が終わった後に実行される。また、非同期処理と同期処理はメインスレッドで実行される。 - setTimeout関数は非同期の処理を登録しているだけであって、実際に実行している訳ではない。 - Promiseは「お風呂湧けたよ」のメタファーで理解する。Promise:「お風呂湧くまで部屋で待ってて〜」、resolve:「お風呂湧けたよ〜」、reject:「お風呂の栓抜けてた!」 - @fuwa - 非同期処理の実行は、同期処理が全て終わってから。(同期処理が終わる前でできるのは登録だけ) - `try...catch` 構文では非同期的に発生した例外をキャッチすることはできない。コールバック関数内に書く必要がある。(自作サービスでやらかしたかも。。。) - dawa - 非同期処理は同期処理と同じメインスレッドで実行されるので同期処理の影響を受ける。 - setTimeout関数は処理を登録するのみで、同期処理が終わったらその登録された処理が呼び出される。 - haruguchi - 同期処理に非同期処理が割り込むことはない - ランダムで失敗するようにコード改良しておきました。 - 非同期処理はいろんな概念が絡み合ってできているのでむずい。 ### 本日の振り返り(よかった点・次回に向けての改善点・今の気分などなんでもOK) - maimu - ルービックキューブで完全一面が作れるようになりました!! - CS50を見ているので、地味にC言語の基本を勉強する感じになっています👶🏻 - @fuwa - Ruby Silver対策にRExをやってみたのですが、34点でしたww - 明日は雨の中お外でチラシを配るバイトをする予定なのでげっそりしてます :coffee: - ファイトです!風邪にお気をつけて。 - ありがとうございます〜! - まっきー - 先日のRubyKaigiのLT資料に「(RUNTEQ生が)釣れたwww」とか書いた資料を直さずそのまま外出ししてしまい、伊藤さんにご指摘いただきました・・・🙏 - 内向けの資料でも外に出すことを意識すること大事! - speakerdeckのURL気をつけないと変なのになってる人がいた。注意! - @haruguchi - 雨すごい - 高知がすごいみたいです。 - dawa - 睡眠が足りてないので昨日から眠いです。 - umizaru - 6月24日(土)にFBC向けのもくもく会をしようと思っています〜。ご都合よろしければぜひ!今週末には周知せねば。 - 何時ごろを予定していますか? - 14-18@新橋周辺を予定してます!(その後任意でご飯会です) - オフラインですね、楽しそうです!! - 行けたらいきたいです! - チャリで行くわ!(20時間あったら、、、)

    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