updated so that javascript-object can have more methods like dict: get, set, keys, values.