The way you're generating your dictionary
s wrong; it's syntactically valid, but it's almost certainly not what you intended to do. It's not binding the key apple
to that object. Rather, it's defining an implicit (global) variable named apple
and assigning the object to that, as well as the first element of the array.
Try this:
var dictionary= {
apple: {name:"apple",pos:"noun",d:"",c:["fruit"]},
banana: {name:"banana",pos:"noun",d:"",c:["fruit"]}
};
console.log(dictionary["apple"].pos); // "noun"
// This also works:
console.log(dictionary.apple.pos); // "noun"