var a = new Array();
var b = new Array();
var c = [a,b];
var str = 'hello,world,nice,day';
for(var i = 0; i < c.length; i++){
c[i] = str.split(',');
}
After execution i'd like to have:
c = [a, b];
a = ['hello', 'world', 'nice', 'day'];
b = ['hello', 'world', 'nice', 'day'];
but really i have:
c = [['hello', 'world', 'nice', 'day'], ['hello', 'world', 'nice', 'day']];
a = [];
b = [];
could i fix it?
upd: Decision by Raynos is really nice. Thx.