You are trying to pass your object to a property, and this property will be the only object:
dictionaries.english_to_french = {english:"hello",french:"bonjour"} ;
You do not need extra { } . You can immediately declare everything:
var dictionaries = { english_to_french: { english: "hello", french: "bonjour" } };
I would suggest that the best format for your dictionaries might be:
var dictionaries = { english_to_french: { "hello": "bonjour", "chicken": "poulet",
This way you can directly search for words without searching. Then you can create a reverse dictionary:
dictionaries.french_to_english = function(dict) { var rv = {}; for (var eword in dict) rv[dict[eword]] = eword; return rv; }(dictionaries.english_to_french);
source share