2011-08

What is the correct media type for JavaScript source code?

[2011-08-15] dev, javascript, clientjs
Question: What media type should you use for JavaScript source code? Answer [via Brendan Eich] and explanations after the break.

JavaScript’s JSON API

[2011-08-06] dev, javascript, jslang
JSON is a plain text data storage format. This blog post describes what it is and how to work with it via an ECMAScript 5 API.

JavaScript performance: Array.prototype versus []

[2011-08-01] dev, javascript, jslang
Array.prototype contains many generic methods that can be applied to array-like objects. [] is a popular shortcut for accessing these methods. This post examines the pros and cons of using that shortcut.

Update: Inspired by a comment from Kevin Roberts, I’ve added a third way of accessing generic methods, and a conclusion.

2011-07

test262 – ensuring that JavaScript implementations comply with the ECMAScript specification

[2011-07-28] dev, javascript, jslang
With so many JavaScript implementations out there, how do you guarantee that all of them stay true to ECMA-262 (the ECMAScript language standard)? The answer is test262, a suite of tests to be run by an implementation. Quote from the test262 website:

ECMAScript.next: Array.from() and Array.of()

[2011-07-26] esnext, dev, javascript, jslang
Update 2014-05-08. Newer version of this post: “ECMAScript 6’s new array methods

On July 9th, Brendan Eich announced that Rick Waldron had prototyped [1] two new methods for ECMAScript.next: Array.from() and Array.of(). Both methods are also useful in current JavaScript.

JavaScript properties: inheritance and enumerability

[2011-07-16] dev, javascript, jslang
Update 2012-10-29:Properties in JavaScript” is a general introduction to how properties work.

This post examines how inheritance and enumerability affect operations on properties in JavaScript.

Programming: the benefits of taking a break

[2011-07-14] dev, software engineering
This post lists several benefits of taking a break during programming.

SourceMap on Firefox: source debugging for languages compiled to JavaScript [update: WebKit, too]

[2011-07-10] dev, firefox, javascript
Update 2011-09-16: Source maps are coming to WebKit, too. Mozilla and WebKit implementers might even agree on a common format.

More and more languages are compiled to JavaScript. Mozilla has plans to let you debug those languages in their source code (no need to look at JavaScript).

2011-06

A JavaScript glossary: ECMAScript, TC39, etc.

[2011-06-27] esnext, dev, javascript, jslang
This blog post explains the difference between JavaScript and ECMAScript. And the differences between ECMAScript.next, ECMAScript 6 and ECMAScript Harmony.

Prototypes as classes – an introduction to JavaScript inheritance

[2011-06-25] esnext, dev, javascript, jslang
Updates – read first: JavaScript’s prototypal inheritance is hard to understand, especially for people coming from other languages that are used to classes. This post explains that it does not have to be that way: The proposal “prototypes as classes” is a simplification of classes and inheritance in JavaScript. It might become part of ECMAScript.next, a.k.a. “the next version of JavaScript” (after ECMAScript 5). But there is also a library that allows you to use its features in today’s JavaScript. What’s intriguing about prototypes as classes is that they aren’t a radical departure from current practices, but rather a clarification of them.

Incidentally, this post is also a good introduction to JavaScript inheritance, because the basics are easier to understand with prototypes as classes.