I need to create an array cells as described in my comment.
I would like to know what is wrong with this script, and the more perfomant way to achieve this result.
Look at the js fiddle http://jsfiddle.net/XvTrf/5/
var data = ['D-0','D-1','D-2','D-3','D-4','D-5','D-6','D-7','D-8','D-9'];
var cells=[];
var d = 0, lenD = data.length;
while(d< lenD){
if(d === 1 || d === 5 || d ===6){
cells.push('test');
}else {
cells.push(data[d]);
}
d++;
}
console.log(cells);
/* result wanted
D-0
test
D-1
D-2
D-3
test
test
D-4
D-5
D-6
D-7
D-8
D-9
*/