So fügen Sie einem TypeScript -Array ein Element hinzu
your_array.push(the_element);
Annoyed Antelope
your_array.push(the_element);
var numbers = new Array(1, 4, 9);
var length = numbers.push(10);
console.log("new numbers is : " + numbers );
length = numbers.push(20);
console.log("new numbers is : " + numbers );
//push
type Push<T extends Array<unknown>, U> = [...T, U];
type pushArray = Push<['a', 'b'], 'c'>;