I am trying this to get 2 values to be inserted in an js array.
$scope.ttabs = [];
for(p = 1; p <= $scope.no_of_groups; p++) {
$scope.ttabs[p] = [1];
console.log($scope.ttabs);
}
the p $scope.no_of_groups is here has value 2.
Now I am getting console output as ..
[undefined, [1], [1]]
why does it showing undefined at first index?