2012-11

Coercing objects to primitives

[2012-11-27] dev, javascript, jslang
This blog post looks at how JavaScript coerces objects to primitives. If you don’t know the difference between primitive values and objects, I suggest you consult my article “Categorizing values in JavaScript” at the Adobe Developer Connection. This post was triggered by the following tweet by David Bruant:
!!(new Boolean(false)) #wtfjs
The result of the above expression is true. Let us first learn about coercion in JavaScript. We can then use that knowledge to understand this result.

Jed – a JavaScript internationalization toolkit

[2012-11-21] dev, javascript, clientjs
Internationalization is still a tricky problem: we are still figuring out how to encode text properly, let alone store content in a manner that lets us translate it easily. In contrast, in other areas of web development, tools and technologies are in place so that even non-technical users can be productive. One example is content authoring – you don’t have to know how to write HTML or how to set up a server in order to publish a blog.

JavaScript inheritance: beyond the basics (video)

[2012-11-19] dev, javascript, jslang
The video recording of my JSConf EU talk “JavaScript inheritance: beyond the basics” is online (you can also download the slides). Outline:
  • JavaScript inheritance basics
  • Object exemplars
  • ECMAScript 6 classes
  • Super-references
  • __proto__

A proposal for using Canvas in web workers

[2012-11-18] dev, html5, javascript, clientjs
Ian Hickson, editor of the HTML spec, has proposed a way to let web workers use Canvas.

Variable declarations: three rules you can break

[2012-11-13] dev, javascript, jslang, jsstyle
This blog post mentions three rules that are commonly given for using var statements. And then tells you when you can break them. To make things easier to understand, I somewhat disparagingly call the rules “conventional wisdom” and breaking the rules “unconventional wisdom”. But I will also explain why the rules have been created in the first place.

Four talks on ECMAScript 6/ECMAScript.next

[2012-11-12] esnext, dev, javascript

A guide to 2ality’s posts on ECMAScript.next/ECMAScript 6

[2012-11-09] esnext, 2ality, dev, guide, javascript
This blog post gives an overview of the 2ality posts on the next version of ECMAScript, ECMAScript 6 (code-named ECMAScript.next). All of those posts have the label esnext. Consult the sitemap for a list of all guides.

Property assignment and the prototype chain

[2012-11-07] dev, javascript, jslang
This blog post examines how the prototype chain of an object affects assignments to its properties. It provides a more detailed look than the previous, more comprehensive, blog post “Properties in JavaScript: definition versus assignment”.

The text “__proto__” can break a webapp

[2012-11-06] esnext, dev, javascript, __proto__, jslang
[This post is part of a series on the special property __proto__]

The text “__proto__” can still break webapps if it appears somewhere in the content, as I was reminded of today, via Domenic Denicola and Peter van der Zee.

What is the best display aspect ratio for tablets?

[2012-11-04] mobile, computers, tablet
One marked difference between current tablets is the aspect ratio of their displays. This blog post explores the pros and cons of the different aspect ratios, along with the question whether one of them is best overall.