I have problem when running below code. stock50 is quite normal array which contains 50 object with name and number (not empty).
AAA, BBB, CCC, DDD all look fine in console.log, but EEE only shows 9 elements and the last element is undefined. I've tried to change 9 to any number, but the last one always shows undefined. However, it's fine in JsFiddle.
stock50 array is just as below ....
runStockDraw : function(option){
var pickingStock = stock50,
tempArray = function(){
var array =[],
i = 0;
while(i<10){
// AAA console.log(array[i-1]);
// BBB console.log(i);
array[i] = {};
// CCC console.log(array[i]);
array[i] = $.extend({},stock50[i]);
// DDD console.log(array[i]);
i++;
}
// EEE console.log(array);
return array;
}();
var updateData = function(){
var i = 0,j=0,
temp = tempArray.shift(),