Bracketing variable names with double underscores is a tradition in Python that JavaScript has borrowed a few times, most prominently for the property __proto__ [1] (which is currently non-standard, but will become part of ECMAScript 6). For Python, the following pronounciation has been suggested by Ned Batchelder:
An awkward thing about programming in Python: there are lots of double underscores. For example, the standard method names beneath the syntactic sugar have names like __getattr__, constructors are __init__, built-in operators can be overloaded with __add__, and so on. [...]Thus, __proto__ is pronounced “dunder proto”.My problem with the double underscore is that it's hard to say. How do you pronounce __init__? “underscore underscore init underscore underscore”? “under under init under under”? Just plain “init” seems to leave out something important.
I have a solution: double underscore should be pronounced “dunder”. So __init__ is “dunder init dunder”, or just “dunder init”.
var record = {}; record["first"] = "Jane"; // OK record["last"] = "Doe"; // OK record["__proto__"] = "Type"; // Not OK, sets prototypeThe last line changes the object’s prototype – meta-data is influenced by data. You can protect yourself against this kind of problem [2], but it would be better to not rely on names for special properties that might appear as strings in user data. Therefore, special properties will be implemented via name objects [3] in ECMAScript.next. Those objects don’t ever clash with each other and are disjoint from strings. Then JavaScript programmers can freely choose names for their properties, without having to worry about clashing with current and future special properties.