“In C++ or C#, when we’re talking about objects, we’re referring to instances of classes or structs. Objects have different properties and methods, depending on which templates (that is, classes) they are instantiated from. That’s not the case with JavaScript objects. In JavaScript, objects are just collections of name/value pairs – think of a JavaScript object as a dictionary with string keys.”

摘录来自: Manuel Kiessling. “The Node Beginner Book”

自己在 node 中尝试

> var handle = {}
> handle["/"] = 'aaa';
> handle["/start"] = 'aaa/start';
> handle["/upload"] = 'aaa/upload';
> handle
{ '/': 'aaa',
'/start': 'aaa/start',
'/upload': 'aaa/upload' }
> typeof(handle)