JavaScript is Spartan when it comes to built-in data structures. One commonly uses objects as maps from strings to values. This post points out three pitfalls when doing so. Pitfall 1: inheritance and reading properties When it comes to reading properties, there are two kinds of methods in JavaScript. On one hand, methods that access the whole prototype chain of an object and thus “see” inherited

