在MDC找到了这个,但是我想如何添加一个私有变量
var dataset = {
tables:{
customers:{
cols:[ /*here*/ ],
rows:[ /*here*/ ]
},
orders:{
cols:[ /*here*/ ],
rows:[ /*here*/ ]
}
},
relations:{
0:{
parent:'customers',
child:'orders',
keyparent:'custid',
keychild:'orderid',
onetomany:true
}
}
}
Run Code Online (Sandbox Code Playgroud)
我在Javascript中理解OOP的方式,如果存在这样的项目,我可以访问dataset.tables.customers.cols [0].
但是,如果我想将私有变量放入客户,那会是什么样子?在运行时错误中
添加var index = 0;结果.