Free email newsletter: “ES.next News

2013-08-28

We need intelligence, not intellect

Quoting “Why Are Some People So Smart?” by MG Siegler:
If parents use IVF to conceive, then a genetic test—an extension of the screening tests for genetic diseases that are already routinely done on embryos—could let them pick the smartest genome from a batch of, say, 20 embryos.

2013-08-25

Protecting objects in JavaScript

This blog post is a quick refresher of how objects can be protected in JavaScript. There are three levels of protection:
  1. Preventing extensions is the weakest level,
  2. sealing is stronger,
  3. freezing is strongest.

2013-08-20

Why all objects are truthy in JavaScript

In JavaScript, all objects are truthy [1], even new Boolean(false), empty arrays and empty objects:
    > Boolean(new Boolean(false))
    true
    > Boolean([])
    true
    > Boolean({})
    true
That is different from how objects are converted to number and string, where you can control the result by implementing the methods valueOf() and toString() [2].

2013-08-11

Callable entities in ECMAScript 6

Update 2013-11-28: There won’t be generator arrow functions in ECMAScript 6 (details).

In ECMAScript 5, one creates all callable entities via functions. ECMAScript 6 has more constructs for doing so. This blog post describes them.

2013-08-08

The flag /g of JavaScript’s regular expressions

This blog post describes when and how to use regular expressions whose flag /g is set and what can go wrong.
(If you want to read a more general introduction to regular expressions, consult [1].)

2013-08-04

Directories for JavaScript resources

I recently asked on Twitter whether people knew any good directories for JavaScript libraries and got several good answers.