0
var config = {
xxx : 'foo'
}
var env = {
foo : {
},
bar : {
}
}
如何使用对象值从其他对象检索值?Javascript - 依赖其他对象的对象
喜欢:
env.config.xxx?
var config = {
xxx : 'foo'
}
var env = {
foo : {
},
bar : {
}
}
如何使用对象值从其他对象检索值?Javascript - 依赖其他对象的对象
喜欢:
env.config.xxx?
var object1 = { value : 'hello' }
var object2 = { o : object1 }
alert(object2.o.value);
小心分号和'config'那个逗号。 http://goo.gl/JYnzc – Oleg