let foo={
name:"",
method:function(){
function bar(){
return "bar";
}
//bar(); //(2)
}
};
foo.method.bar(); //(1)
(1): throws a Uncaught TypeError: c.method.bar is not a function, 我知道foo.method.bar
正在搜索名为bar
inside的属性键/名称,但这不存在,所以当我从外部访问时method
如何调用而不做这个 (2)bar
foo