タグ

es7に関するigrepのブックマーク (2)

  • do式が実装された - JS.next

    概要 ブロック文のようでありながら、かつ中に書かれた最後の式の評価を返すdo式が実装された。 基 let foo = do { // ブロックスコープを作る let x = 1 + 1 // 中に文(や式)を記述できる x + 3 // 最後に評価された式がdo式の結果となる function fn(){} // 文は評価されない } console.log(foo) // 5 但しfor文やwhile文などは少し注意が必要で、 まず初期化部、条件部、更新部の評価はdo式が返す値にならない。 let bar = do { for (let i = 1; i <= 10; i++) i } // 実際の最後の式評価は (11 <= 10) => false console.log(bar) // 10 そして処理部に何も書かれていない場合でも、undefinedと評価される。 let ba

    do式が実装された - JS.next
    igrep
    igrep 2015/10/24
    do記法じゃなかった 😔
  • ECMAScript 6 compatibility table

    V8 SpiderMonkey JavaScriptCore Chakra Carakan KJS Other ⬤ Minor difference (1 point) ⬤ Small feature (2 points) ⬤ Medium feature (4 points) ⬤ Large feature (8 points) Compilers/polyfills Desktop browsers Servers/runtimes Mobile Feature name Current browser ES6 Trans- piler Traceur Babel 6 + core-js 2 Babel 7 + core-js 2 Babel 7 + core-js 3 Closure 2020.09 Closure 2021.08 Closure 2021.09 Closure 20

  • 1