You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Introduction この記事は最近JavaScriptに入ったGeneratorと呼ばれる機能について知りたい、もっと詳しく知りたいという方をターゲットとしています。 今回はECMAScript 2015に入った機能のgeneratorについて解説していきたいと思います。 generatorはNode界隈では2014年ごろから非同期処理を同期的に書くことができるツールとしてよく使われていました。 最近ではasync/awaitをよく耳にすることがあると思いますが、async/awaitはgeneratorを使ったものに変換可能なので挙動としては近いものと考えてもらって大丈夫です。 ECMAScript Async Functions What is generator 前置き では、generatorとはなんでしょうか?「実はgeneratorはIteratorを返す関数なのです!」
In this blog post, I show six tricks enabled by new ES6 features. At the end of each section, I point to related material in my book “Exploring ES6” (which is free to read online). Enforcing mandatory parameters via parameter default values # ES6 parameter default values are only evaluated when they are actually used. That lets you enforce that a given parameter be provided: /** * Called if a par
Last week I wrote about the yield return statement in c# and how it allows for deferred execution. In that post I explained how it powers LINQ and explained some non-obvious behaviors. In this week’s post I want to do the same thing but for Javascript. ES6 (ES2015) is becoming more and more mainstream, but in terms of usage I mostly see the more common arrow-functions or block-scoping (with let an
Show navigation The V8 team places great importance on the evolution of JavaScript into an increasingly expressive and well-defined language that makes writing fast, safe, and correct web applications easy. In June 2015, the ES2015 specification was ratified by the TC39 standards committee, making it the largest single update to the JavaScript language. New features include classes, arrow function
Meta Description: As AI continues to evolve, 2026 promises significant shifts in tech landscapes, compelling businesses to adapt or fall behind. Focus Keyword: AI advancements in 2026 As we approach 2026, artificial intelligence (AI) is… Meta Description: Explore how AI’s integration in various sectors is transforming the technology landscape and shaping the future of industries by 2026. Focus Key
const areThey = 'Yes'; console.log(`${areThey}, they are`); // Logs: Yes, they are function strongValues(strings, ...values) { return strings.reduce((totalStr, str, i) => { totalStr += str; if (i in values) totalStr += `<strong>${values[i]}</strong>`; return totalStr; }, ''); } const areThey = 'Yes'; console.log(strongValues`${areThey}, they are`); // Logs: <strong>Yes</strong>, they are The synta
ES6 module loading: More complicated than you thinkModule JavaScript can be indistinguishable from non-module JavaScript. One of the most long-awaited features of ECMAScript 6 is the formal definition of modules as part of the language. For years, JavaScript developers have struggled with organizing their code and needing to decide between alternate ad-hoc module formats like RequireJS, AMD, and C
This blog post gives tips for error handling in asynchronous, Promise-based functions. Operational errors vs. programmer errors # In programs, there are two kinds of errors: Operational errors happen when a correct program encounters an exceptional situation that requires deviating from the “normal” algorithm. For example, a storage device may run out of memory while the program is writing data t
Please note that this polyfill is now in maintenance mode, as of Jan, 2023. We are not planning to add more features or enhancements. This is a polyfill for the Proxy object, part of ES6. See the MDN docs or Introducing ES2015 Proxies for more information on Proxy itself. Unlike other polyfills, this does not require Object.observe, which is no longer supported anywhere. ⚠️ Note that Firefox, Chro
Presented at UtahJS 2015 and Fluent 2016 Disclaimer: a lot of the pictures were animated GIFs. That doesn't come through on SpeakerDeck
概要 インスタンスであるか判定するためのビルトインシンボルが実装された。 解説 instanceof演算子が「 obj instanceof C 」の形で使われると、「 C[@@hasInstance] 」が定義されていた場合objを引数に呼ばれ、それが返す真偽値が返される。 class X { } class A { static [Symbol.hasInstance](obj) { return obj.constructor == X } } let a = new A, x = new X console.log( a instanceof A ) // false console.log( x instanceof A ) // true ちょっと変わった利用例 型判定に使う const StringOrNumber = { [Symbol.hasInstance](v) {
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く