How do I enter successive nulls in a javascript array?
I am having trouble understanding how to enter successive null values in a JS array. This is my working script:
var myApp = angular.module("myApp", []);
myApp.controller("myCtrl", function($scope) {
$scope.items = [];
$scope.items[0] = [,,"this doesn't work"];
$scope.items[0] = [null,"this works"];
$scope.items[1] = [null,,"this works"];
$scope.items[2] = [null,null,"this doesn't work"];
$scope.items[3] = [null,,,"this doesn't work"];
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<body ng-app="myApp">
<div ng-controller="myCtrl">
<table>
<tr ng-repeat="row in items">
<td ng-repeat="column in row">{{column}}</td>
</tr>
</table>
</div>
</body>