I am trying to create an array in jQuery that fills through a loop.
count = jQuery('#count_images').val();
With the code above, I get an integer value (e.g. 5). I would like to know how I can do something like this in jQuery:
int arrLength = count;
string[] arr1 = new string[arrLength];
int i = 0;
for (i = 0; i < arr1.Length; i++){
arr1[i] = i;
}
So, at the end of my array, for example, 5 would look like this: [1,2,3,4,5].
source
share