doox911,
var mas_tree = [];
var tree = {
tree_id:''
};
var n = 0;
function data_tree(){
tree.tree_id = n;
mas_tree[n++] = tree;
}
data_tree()
data_tree()
alert(JSON.stringify(mas_tree))
почувствуйте разницу
var mas_tree = [];
var n = 0;
function data_tree() {
var tree = {
tree_id: ''
};
tree.tree_id = n;
mas_tree[n++] = tree;
}
data_tree()
data_tree()
alert(JSON.stringify(mas_tree))
|