Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to push an object into an array typescript

const places: { city: string; country: string }[] = [];

places.push({ city: 'Nairobi', country: 'Kenya' });
 
PREVIOUS NEXT
Tagged: #push #object #array #typescript
ADD COMMENT
Topic
Name
5+1 =