I am test JavaScript dictionary on node console as follows
$ node
> var dict = {};
undefined
> dict["t"] = "table";
'table'
> console.log(dict);
{ t: 'table' }
undefined
> dict["f"] = "field";
'field'
> console.log(dict);
{ t: 'table', f: 'field' }
undefined
> console.log(dict.t);
table
undefined
> console.log(dict.f);
field
undefined
> console.log(dict['f']);
field
undefined
> var str = "f";
undefined
> console.log(dict[str]);
field
undefined
The dictionary works fine but what are those "undefined" mean? What did I miss here?
Thanks,
console.log()returnsundefined, and similarly avardeclaration results inundefined.undefined