var a = {method:b.method,name:'zhangsan'};var b = {method:'car',name:a.name};这样写会报错而且,怎么让两个对象之间能互相拿到值。但是如果写成函数的形式就能拿到值,奇怪了var a = {method:function(){ console.log(b.method); },name:'zhangsan'}var b = {method:'car',name:a.name};a.method();//能打印出'car'
添加回答
举报
0/150
提交
取消