function jsonObj(text, nodes){
this.text =text;
this.nodes =nodes;
}
我想把nodes作为数组,这样可以插入多个对象,现在这样只能插一个对象
function jsonObj(text, nodes){
this.text =text;
this.nodes =nodes;
}
我想把nodes作为数组,这样可以插入多个对象,现在这样只能插一个对象
function jsonObj(text, nodes){
this.text =text;
this.nodes =[nodes];/////
}
jsonObj.prototype.add=function(node){
this.nodes.push(node)
}