This is my array definition (probably there is a problem. I wanted to say that this array will be an array of custom objects):
const records: {LicencePlate: string, Description: string,
SetToUse: string, Depot: string, Active: boolean}[] = [];
Then I want to fill it:
this.grid.gridView.data.forEach(element => {
records.push(element.LicencePlate, element.Description, element.DateOfStartUse.toLocaleDateString('en-GB'),
element.Base, element.Active);
});
I wanted to get something like this - array of objects
[{"Johnny", "Actor", "05/03/2000", "Holywood", true},
{"Kirk", "Musician", "01/06/1999", "California", true},
{"Elvis", "Singer", "15/09/1975", "Mississippi", false}]
But I got only one long array of single values:
["Johnny", "Actor", "05/03/2000", "Holywood", true,
"Kirk", "Musician", "01/06/1999", "California", true,
"Elvis", "Singer", "15/09/1975", "Mississippi", false]
Where have I made a mistake?