就像是
var life= { users : { guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls : function(){ this.SOMETHING.kiss(this.boys); }, }, mameAndDestroy : function(group){ }, kiss : function(group){ } };
这是我想象的格式,但事实并非如此。什么会退回到对象的父级?
JavaScript本身不提供此功能。而且我怀疑您是否可以创建这种类型的功能。例如:
var Bobby = {name: "Bobby"}; var Dad = {name: "Dad", children: [ Bobby ]}; var Mom = {name: "Mom", children: [ Bobby ]};
鲍比属于谁?