I have the following code
function slotCalc(a, b) {
var array = ["default"];
while (a < b) {
var obj = { test: "test" };
array.push(obj);
b++;
}
return array;
}
I can not understand why the array is not returned. If I remove the while loop, its returned as expected.
How can a while loop do this?