ES.next News got a new name - we're now ! If you are not redirected within 3 seconds, click here to go to our new page.
In this blog post, I present enumify, a library for implementing enums in JavaScript. The approach it takes is inspired by Java’s enums. Enum patterns # The following is a naive enum pattern for JavaScript: const Color = { RED: 0, GREEN: 1, BLUE: 2, } This implementation has several problems: Logging: If you log an enum value such as Color.RED, you don’t see its name. Type safety: Enum values are
Every JavaScript developer wants to be up-to-date with the latest technologies, but when you are too busy it’s just not easy. How do you start and where do you find a detailed explanation? This is an introduction for a type of series, in which I want to provide a detailed explanation of the next generation JavaScript syntax. This will be a detailed guide for the most important functionality. A gui
This blog post explains four approaches for managing private data for ES6 classes: Keeping private data in the environment of a class constructor Marking private properties via a naming convention (e.g. a prefixed underscore) Keeping private data in WeakMaps Using symbols as keys for private properties Approaches #1 and #2 were already common in ES5, for constructors. Approaches #3 and #4 are new
1. About this book 2. Deploying ECMAScript 6 2.1 Using ECMAScript 6 today 2.2 ES6 REPLs 2.3 Transpilation tools 2.4 Other useful ES6 tools and libraries 2.5 The future: native ES6 2.6 Are there ES6 features that can’t be transpiled to ES5? 3. Babel setups for browsers and Node.js 3.1 npm and local installs 3.2 Source maps 3.3 Browser setup: ES6 via webpack and Babel 3.4 Node.js setup: Dynamically
Mixins and Javascript: The Good, the Bad, and the Ugly.Mixins and JavaScript are a like the classic Clint Eastwood movie. The good is that composing objects out of small pieces of implementation is even possible due to JavaScript's flexible nature, and that mixins are fairly popular in certain circles. The bad is a long list: there's no common idea of what the concept of a mixin even is in JavaScr
An Intro To Using npm and ES6 Modules for Front End Development The JavaScript landscape is changing quickly and along with it the way that we work with dependencies in our websites and applications. This post is for developers who are currently loading in their JavaScript via multiple script tags and finding that dependency management is becoming a little cumbersome as their webpages or applicati
This blog post explores references, a mechanism used by the ECMAScript language specification to explain the difference between the following two expressions: obj.prop() (0, obj.prop)() Method calls versus function calls # Consider the following object: var obj = { getThis: function () { "use strict"; return this; }, }; If you call obj.getThis, you have a method call (this points to the object in
This blog post examines how Babel ensures that code it transpiles interoperates properly with normal CommonJS modules. Consult chapter “Modules” in “Exploring ES6” for more information on ES6 modules. Starting point for this series of posts on Babel: “Configuring Babel 6” ES6 modules vs. CommonJS modules # ECMAScript 6 modules # Default export (single export): // lib.js export default function (
Node.js Advent Calendar 2015の7日目の記事です。遅刻してごめんなさいごめんなさい。 sinopiaをs3対応して記事を書こうと思ったのですが、思ったより手こずってしまい、ESLintの2系のalpha版が出たので、そちらについて調べました。 ESLint v2.0.0-alpha-1 released 新しいルール 下記のルールが新しく追加される。 array-callback-return Arrayのfilterやreduceなど、callback内で値を返す必要があるのに返してない場合にエラーを出す。 no-implicit-globals 暗黙的にグローバルに定義されている変数がある場合にエラーを出す no-restricted-imports 任意のパッケージのimportを禁止する prefer-rest-params ES6のRest Parame
概要 Proxyを使うとオブジェクトに対する様々な操作に割り込み、好きな振る舞いをさせることが出来る。 記事更新履歴 [2016/03/23] ES2016でenumerateトラップが削除されるのに対応 [2015/12/02] 公開 APIの概要 提供されるメソッド new Proxy( target<Object>, handler<Object> ) -> <Proxy> // targetオブジェクトを基盤としたプロキシを作る // プロキシへの操作を受ける関数を入れたhandlerオブジェクトを指定する Proxy.revocable ( target<Object>, handler<Object> ) -> { proxy<Proxy>, revoke<Function> } // 無効化可能なプロキシをproxyプロパティに持ち、 // 無効化するためのrevokeメソッ
How to export a JavaScript moduleFew days ago I wrote a tweet that surprised many developers not fully aware on how CommonJS modules work. The same tweet also gave birth to some usual discussion about anti-patterns, confusion, what why and how … after all these years developers still write module.exports.stuff = 123; instead of this.stuff = 123; since module.exports === this — Andrea Giammarchi (@
Perhaps the most important thing you can learn to be a better coder is to keep things simple. In the context of identifiers, that means that a single identifier should only be used to represent a single concept. Sometimes it’s tempting to create an identifier to represent some data and then use that identifier as a temporary place to store values in transition from one representation to another. F
JSer.info #253 - What’s in ECMAScript 2016 (ES7)?という記事では、最近よく見るECMAScript 2016(ES7)というのは実際には何の事を言ってるのかについて書かれています。 TC39とは何か?、今後(ES7から)は機能ごとのProposalとなってること、どのように策定が進んでいくかといったことについて書かれています。 以前自分が書いたIntroduction | ECMAScriptとは何か?や記事と扱ってる内容はかなり近いです。 合わせてES6のエディタであるAllenさんのインタビューも読むと、今後どのようになっていくかが分かりやすいです。 ECMAScript 2015はなぜ策定まで時間がかかったか? 仕様策定のリーダー、アレン・ワーフスブラック氏に聞く:CodeZine(コードジン) 上記の記事と同時期にES6 in Pra
Today, the Kinoma team has completed the move to JavaScript 6th Edition by delivering a firmware update to Kinoma Create and a new version of Kinoma Studio. Both use Kinoma’s XS6 JavaScript engine, an independent implementation optimized for embedding JavaScript in hardware products and applications. XS6 remains the most thorough implementation based on the Kangax compatibility tests, implementing
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く