[Solved] How to Create Array in javascript by loop [closed]


More information is needed to answer your question. But in general, to create an array using a for loop would look something like this:

var ProductPiecePerBundle = 2;
var data = [];

for (i = 1; i < 11; i++) {
    myArray.push({value: ProductPiecePerBundle * i , label: i + " "+ ProductPiecePerBundle * i });
}

To append something to an array you use the push method.

1

solved How to Create Array in javascript by loop [closed]