function myFunction() {
var item = {};
item = {id:'myId', rules: {1:'rule1', 2:'rule2'}};
Logger.log(item); // {id=myId, rules={2=rule2, 1=rule1}}
Logger.log(item.rules[1]); // rule1
var db = ScriptDb.getMyDb();
db.save(item);
var result = db.query({id:'myId'});
item = result.next();
Logger.log(item); // {id=myId, rules={2=rule2, 1=rule1}}
Logger.log(item.rules[1]); // undefined, why?
}
期望最后一个日志像原始对象一样返回值“rule1”。为什么现在未定义?