What is {} + {} in JavaScript?

Recently, the lightning talk “Wat” by Gary Bernhardt pointed out an interesting JavaScript quirk: You get unexpected results when you add objects and/or arrays. This post explains those results.

Trying out Underscore on Node.js

Underscore is a library that nicely rounds out JavaScript’s rather limited standard library. Thanks to the Node Package Manager, it’s very simple to install on Node.js:
    $ npm install underscore


The increasing pervasiveness of JavaScript – a few historic milestones

Update 2012-07-20: O’Reilly has published my mini-ebook “The Past, Present, and Future of JavaScript”. It is free, but you have to enter a name and an email in the box at the right. This ebook can be considered an updated and extended version of this blog post.

JavaScript is used in more and more places. It started out as a scripting language for web content and has migrated to many areas. This post presents the historic milestones of this process. Note: The milestones are about things that changed the public perception of what JavaScript could be used for. Some of these milestones would not have been possible without prior work by others. For example: Mozilla’s contributions in advancing the state of JavaScript cannot be overestimated. The following are the milestones, in chronological order:


Remedies for SOPA causes (a greedy industry in decline, corrupt politics)

This post examines two reasons for why a bill such as SOPA [1] could come into being: First, Hollywood is a greedy industry in decline. Second, it wields significant power via corrupt politics.


JavaScript myth: JavaScript needs a standard bytecode

The idea is obvious: Why not standardize the bytecode of the virtual machines (VMs) that JavaScript runs on? That would mean that JavaScript programs could be delivered as bytecode and thus would be smaller and start more quickly (after having been loaded). Additionally, it would seem to be easier to port other languages to web browsers, by targeting that bytecode. This post makes its case in two steps: First, it shows that bytecode has several disadvantages. Second, it explains that source code is not as bad a solution as it seems.


Apple and the online education revolution

Yesterday’s Apple event on education reflects current trends in computerized learning. So what has Apple introduced?

What is JavaScript’s typeof operator used for?

JavaScript’s typeof is a complicated beast – it can be used for many things, but also has many quirks. This post lists its use cases, points out problems and presents alternatives.


The “no asshole comments” option

This post contains a few thoughts on what can be done about negative comments.


VLC keyboard shortcuts

Tip: “Preferences... → Hotkeys” lists VLC shortcuts. Two handy ones:


The first ECMAScript.next features in Firefox and Chrome

Update 2012-01-23:ECMAScript 6 support in Mozilla” on the Mozilla Development Network.

The next version of ECMAScript (code-named ECMAScript.next [1]) will be standardized by 2013. This post enumerates the first features that are currently being tested in Firefox and Chrome.


Samsung to merge its Bada and Tizen mobile operating systems – Intel still on board?

Quoting “Samsung Merging Its Bada OS With Intel-Backed Tizen Project” by Elizabeth Woyke for Forbes [via Ariya Hidayat]:

Streaming a DVD to another Mac via VLC

This post shows you how to stream a DVD from a sending Mac (e.g. an iMac) to a receiving Mac (e.g. a MacBook Air) using the free VLC media player. The explanation is also valid for other systems running VLC, but you will have to substitute a VNC server and client for the Mac’s built-in Screen Sharing (which is, in fact, based on VNC).


Automatically numbering headings via CSS

This post shows you how to number HTML headings with CSS. That is, given the following HTML.
    <h1>My Article</h1>
With the proper CSS, the above will be displayed as
My Article
1. Introduction
1.1. Rationale
2. Background


GitHub: serve files to the web, with a single branch

GitHub has a nifty feature called GitHub Pages that allows you to serve files in your repository to the web. Those files have to reside in the branch gh-pages, which is different from the usual master branch. To avoid the slightly cumbersome maintenance of two branches, this post shows you how to only work with gh-pages.


JavaScript inheritance by example

Update 2012-03-19: New section on “Objects”, tips for what to read next.

This blog post illustrates several JavaScript inheritance topics via an example: We start with naive implementations of a constructor Point and its sub-constructor ColorPoint and then improve them, step by step.


Crockford’s JSDev: switching off privacy for testing

Today, Douglas Crockford introduced a new project: JSDev. It solves a challenge with privacy: On one hand, you don’t want the outside world to have access to private functionality. On the other hand, you want to test it, via external unit tests.


The pitfalls of using objects as maps in JavaScript

JavaScript is Spartan when it comes to built-in data structures. One commonly uses objects as maps from strings to values. This post points out three pitfalls when doing so.

Dion Almaer on the history of webOS

Dion Almaer was head of webOS developer relations at Palm. He gives a nice account of the history of webOS. Quote:


The multiple roles of JavaScript objects and arrays

Both objects and arrays play multiple roles in JavaScript. This blog post explains what those roles are.