export interface CountryInterface {
countryNameEnglish: string;
countryName: string;
}
let API_DATA = [{
countryCode: "AE",
countryName: "United Arab Emirates",
countryNameEnglish: "United Arab Emirates",
countryPhoneCode: "+971",
published: true
timeZone: "UTC+4"
}]
let countryObjectsArray: CountryInterface[] = API_DATA;
In this example, we have API_DATA of which we only need two values of the object instead of having all the unnecessary object values. But in the example above it will assign all the values. Is there any way to get this done without looping through the data array and assigning each?