2013-07

Array iteration and holes in JavaScript

[2013-07-07] dev, javascript, jslang, jsarrays
The blog post describes how various functions and methods that deal with arrays are affected by holes [1].

Feeds (RSS, Atom) in the time of social media

[2013-07-02] social, blogging, computers
These days, social media (Twitter, Facebook, Google+ etc.) seem much more popular than feeds (RSS, Atom). Google claims about the latter that their “usage has declined”. That begs the question: have social media made feeds irrelevant? This blog post answers that question with a firm “no” and explains why.

2013-06

Iterators and generators in ECMAScript 6

[2013-06-30] esnext, dev, javascript
[2015-02-26] New version of this blog post: “Iterables and iterators in ECMAScript 6

The iterator pattern enables unified and simple access to the elements stored in data structures. Generators are lightweight coroutines. Think: functions that can be suspended and resumed. Among other things, they help with implementing iterators.

This blog post explains how iterators and generators work in ECMAScript 6. The iterator protocol has recently changed, this post explains the new protocol.

Searching websites and evaluating JavaScript via Chrome’s omnibox

[2013-06-26] browser, computers, chrome
This blog post explains how to search several websites (not just a single search engine!) from the omnibox (address bar) in Google Chrome.

Basic JavaScript for the impatient programmer

[2013-06-22] dev, javascript, jslang
Update: This blog post has become a chapter in my book “Speaking JavaScript”. You can read it here: “Basic JavaScript”.

Kind words by Cody Lindley (author of “jQuery Enlightenment”, “JavaScript Enlightenment” and “DOM Enlightenment”):
“Basic JavaScript” … [is the] most complete and concise write up I am aware of.

This blog post enables you to get started with JavaScript as quickly as possible – if you already know how to program. It describes the smallest subset of the language that allows you to be productive. I call that subset “Basic JavaScript” and recommend to program in it for a while, before moving on to more details and advanced topics. Learning everything at once is too confusing. The post concludes with tips for what to learn next.

Video: An overview of ECMAScript 6

[2013-06-20] esnext, dev, javascript, video
On 2013-05-30, I held the talk “An overview of ECMAScript 6” at Fluent Conference, in San Francisco. The video is now publicly available (go there for a larger version of the video). And yes, I was slightly jet-lagged.

with makes it harder to evolve JavaScript

[2013-06-19] dev, javascript, jslang
JavaScript’s with statement has been deprecated for a while [1]: it slows down your code and is forbidden in strict mode. Additionally, it makes it harder to evolve the language, because code that uses it is more brittle.

ECMAScript 6: automatically binding extracted methods

[2013-06-14] esnext, dev, javascript
This blog post demonstrates how to use ECMAScript 6 proxies to automatically bind methods that are extracted from an object.

Freezing instances and the first invoked constructor

[2013-06-08] dev, javascript, jslang
Let’s say you want to write a constructor that produces instances that are frozen (immutable). One problem, you have to solve, is: when do you freeze this? If you always – unconditionally – perform the operation in the constructor then you can’t create sub-constructors that have their own instance properties. This blog post explains how to work around this problem.

Triggering events in vanilla JavaScript

[2013-06-06] dom, dev, javascript, clientjs
So you want to trigger an event for a DOM element, without using jQuery? This blog post gives you a quick recipe for doing so.

The running example is about sending a submit event to a form. I needed to do that for a demo of user interface testing via CasperJS. And, unfortunately, the Form#submit method does not send that event on most web engines.