2012-08

DOM: element IDs are global variables

[2012-08-15] dom, dev, javascript, clientjs
Several tweets mentioned that in order to display an element in Chrome’s JavaScript console, you only have to type its ID. @johnjbarton pointed out that that is because all element IDs are global variables. This blog post explains a few more details.

A closer look at _.extend and copying properties

[2012-08-13] underscorejs, dev, javascript, jslang
Underscore.js is a useful complement to JavaScript’s sparse standard library. This blog post takes a closer look at its extend function. Along the way, it will give a detailed explanation of how to best copy properties in JavaScript. This post requires basic knowledge of JavaScript inheritance and prototype chains (which you can brush up on at [1]), but should be mostly self-explanatory.

Properties in JavaScript: definition versus assignment

[2012-08-08] dev, javascript, jslang
Did you know that defining a property is not the same as assigning to it? This blog post explains the difference and its consequences. It has been triggered by an email from Allen Wirfs-Brock on the es-discuss mailing list.

ECMAScript.next: TC39’s July 2012 meeting

[2012-08-03] esnext, tc39, dev, javascript
TC39 (Technical Committee 39) works on the upcoming ECMAScript.next [1] standard. They have several meetings per year and in July, there was another one. This blog post summarizes the most important decisions. It is based on the following minutes by Rick Waldron:

2012-07

ECMAScript 6: classes

[2012-07-29] esnext, dev, javascript
[Update 2015-02-15] Newer version of this blog post: “Classes in ECMAScript 6 (final semantics)

During the July 2012 meeting of TC39 [1], classes have been accepted for ECMAScript 6, the upcoming version of the JavaScript language standard. This blog post explains how those classes work. It is based on Allen Wirfs-Brock’s annotated slides.

Apply and arrays: three tricks

[2012-07-24] underscorejs, dev, javascript, advancedjs, jslang, jsarrays
This blog post describes three tricks for working with arrays via apply.

Explaining to non-programmers what JavaScript is

[2012-07-23] dev, javascript, computers
When I tell non-programmers that what I do professionally involves JavaScript, I most commonly get the reaction: “Isn’t that that thing that you have to install and that makes the browser slow?”. This answer surprises me in two ways:

Implementing a command line with eval in JavaScript

[2012-07-16] eval, dev, javascript, jslang
This blog post explores JavaScript’s eval function by implementing the foundation for an interactive command line. As a bonus, you’ll get to work with ECMAScript.next’s generators (which can already be tried out on current Firefox versions).

Programming: initially a female profession

[2012-07-13] society, life, computers
In the 1940s, the first computer programmers were all women. That only changed later. Quoting “Researcher reveals how ‘Computer Geeks’ replaced ‘Computer Girls’” by Brenda D. Frink for the Clayman Institute for Gender Research:

Combining code editing with a command line

[2012-07-10] dev, hci, javascript
Update 2012-09-05: separated input and output.

Currently, you are forced to work with JavaScript code in either of two modes: You can either use a code editor and edit multiple lines or you can use an interactive command line and work with one line at a time (editing, evaluating). With jsrepl [GitHub project, live demo], I have prototyped a combination of both modes – no need to chose, any more.