2011-04

Iterating over arrays and objects in JavaScript

[2011-04-20] dev, javascript, jslang
This post explains three approaches for extracting information from arrays and objects:
  1. for loops,
  2. array methods (courtesy of ECMAScript 5 [1]),
  3. listing property keys.
It concludes with best practices for applying these approaches.

JavaScript: converting any value to an object

[2011-04-17] dev, javascript, jslang
This post is about converting between primitive values and wrapper objects [1]. Thankfully, one is usually not faced with this kind of task in JavaScript. The most frequent use case is to add properties to a primitive. As a primitive is immutable, you need to convert it to a wrapper object to do so. Read on if you want to see some of JavaScript’s more obscure corners.

Let us start with a short quiz:
What does ({}).valueOf.call(myvar) do?

Internet Explorer 10 is “native” and good for webapp developers

[2011-04-13]
The Internet Explorer 10 Preview (IE10) comes with many new features, two of them are especially good news for webapp developers:

The Singleton pattern in JavaScript: not needed

[2011-04-12] dev, javascript, jslang
This post argues that the singleton pattern is usually not needed in JavaScript, because you can directly create objects. It then slightly backpedals from that position and shows you code skeletons that you can use if your needs go beyond the basics.

The Singleton pattern and its simplest implementation in Java

[2011-04-10] dev, java
This post motivates the Singleton design pattern and explains its implementation in Java.

Information management classics: Lifestreams (1996)

[2011-04-08] info mgmt, computers
Lifestreams [1] were created in 1996 to correct some of the shortcomings of document management when used for personal information management. Even today, document management is still the dominant way of information management, both conceptually and as a user interface metaphor. Some of the shortcomings are:

How Google Chrome reduces the processor load of webapps

[2011-04-06] browser, computers, chrome
With the web’s popularity, it is common for web browsers to have many open tabs at the same time. Processor load can significantly increase in such a case. Google Chrome has implemented several measures to help with that:

JavaScript: an overview of the regular expression API

[2011-04-01] dev, javascript, jslang, regexp
Updates: This post gives an overview of the JavaScript API for regular expressions. It does not, however, go into details about regular expression syntax, so you should already be familiar with it.

Using HTML5 figures in today’s browsers

[2011-04-01] dev, html5
HTML5 includes tags for figures and figure captions. This post explains how to use them in modern browsers.

2011-03

A first look at the upcoming JavaScript modules

[2011-03-27] esnext, dev, javascript
Update 2012-10-22: Note that this feature is still actively being worked on and in flux.

Judging by a tweet by David Herman, he is excited about something (he is shouting!) and so should we be:

MODULES FOR ECMASCRIPT, Y'ALL. MODULES FOR ECMASCRIPT. THAT IS ALL. [@littlecalculist]
This means: ECMAScript Harmony (or ECMAScript.next [1]), as it is currently being planned, will have modules. This post gives you a first look, summarizing the material at [2].