High-Speed ES2015 Benedikt Meurer Google Munich @bmeurer
High-Speed ES2015 Benedikt Meurer Google Munich @bmeurer
Show navigation Over the last couple of months the V8 team focused on bringing the performance of newly added ES2015 and other even more recent JavaScript features on par with their transpiled ES5 counterparts. Motivation #Before we go into the details of the various improvements, we should first consider why performance of ES2015+ features matter despite the widespread usage of Babel in modern we
ES6 Features Arrow Functions A short hand notation for function(), but it does not bind this in the same way. no-eval var odds = evens.map(v => v + 1); // no parentes and no brackets var nums = evens.map((v, i) => v + i); var pairs = evens.map(v => ({even: v, odd: v + 1})); // Statement bodies nums.forEach(v => { if (v % 5 === 0) fives.push(v); }); How does this work? var object = { name: "Name",
In the previous article Native ECMAScript modules: the new features and differences from Webpack modules we understood the differences between ES modules and their implementation in bundlers/compilers like Webpack/Babel. So far we found couple gotchas and know how to use the import \ export declarations and which caveats we may have using them in JS. But JavaScript went asynchronous many years ago
Get the book Read online for free. Buy the ebook (DRM-free PDF, EPUB, MOBI) and support my work. About the book “Exploring ES2016 and ES2017”: Covers what’s new in ECMAScript 2016 and ECMAScript 2017. If you want to know more about the rest of JavaScript, consult Axel’s other books. About the author Dr. Axel Rauschmayer specializes in JavaScript and web development. He blogs, writes books and teac
es6-feature-detection.js �; ʪ� �H ʪ� var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + 'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + 'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;
Want the TL;DR version? Here’s a gist of all three examples. Async generators and async iteration have arrived! Err, they’ve reached Stage 3, which means they are likely to ship in a future version of JavaScript. Until then, you can enable Stage 3 proposals in Babel to try them out in your own projects. The web is essentially a decentralized app runtime, so subpar language additions have permanent
One of the prettiest features of ES6, it could easily win a beauty contest, if such a contest would be held. What many people don’t know is that the arrow function is not simply a form of syntactic sugar that we can use instead of the regular callback. As I like to explain it to the people who attend my trainings/workshops, arrow functions are this-less, arguments-less, new.target-less and super-l
Задача: инициализировать массив и заполнить значениями. Раньше задача решалась строкой: var a = Array.apply(null, {length: 8}).map(Number.call, Number);Но сейчас же уже конец 2016 года (считай что уже 2017). И пишем мы давно не на ES5, а на ES2016+… Array.fillЕсть такой метод: Array.fill — заполняет все элементы массива от начального до конечного индексов одним значением. Но его минус в том, что о
ECMAScript Daily そういえば、ECMAScript DailyというECMAScriptの情報サイトをやってます。 2015年12月ぐらいに始めたので、1年ぐらい経ってましたがそういえばブログ書いてないことに気づいたので書いています。 基本的にはJSer.infoのECMAScript特化版という位置づけで、基本的な更新スタンスはJSer.infoとは変わらないです。 週一とかではなくて、新しい情報がでたら直接更新のスタイルなので、Realtime JSer.info(JSer.infoのリアルタイム版)の方がより近いです。 記事自体もほぼリンクだけに近いので、Twitter(@EcmascriptDaily)で見たほうが分かりやすいかもしれません。 Follow @EcmascriptDaily 週1でまとめて見たい場合はECMAScript Dailyからメールマガジン
ES2015でテンプレートリテラルが追加されました。テンプレートリテラルには変数を埋め込むことができるのは周知の事実かと思います。しかし、埋めこむことができるのは実は変数、ではなく式です。今回は式を埋め込むことでできるおもしろいコードを紹介しようと思います。 まず三項演算子です。 const arr = [1, 2, 3]; const s = `arr[0] = ${arr.length > 0 ? arr[0] : 'undefined'}`; s === '1'; 式を埋め込むことができるので、当然テンプレートリテラルを埋め込むこともできます。 const hoge = 42; const s = `${`${`${hoge}`}`}`; s === '42'; また、式が有効なものであれば、途中で空白や改行を挟んでもなんの問題もありません。 const hoge = 42; con
In pure mathematics, zero means nothing and its sign doesn’t matter. +0 = -0 = 0. Computers can’t represent value well enough and mostly use the IEEE 754 standard. Most languages have two zeros! The IEEE 754 standard for floating point numbers allows for signed zeros, thus it is possible to have both -0 and +0. Correspondingly, 1 / +0 = +∞ while 1 / -0 = -∞ and these are values at opposite ends o
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く