📅  最后修改于: 2022-03-11 15:03:52.483000             🧑  作者: Mango
var log = ['test'];
var obj = {
get latest () {
if (log.length == 0) return undefined;
return log[log.length - 1]
}
}
console.log (obj.latest); // Retornará "test".