How to store values of loc[0].trim and loc[1].trim on two variables latitude and longitude
and what type of two variables ?
values of loc[0] and loc[1 already success retrieve values
i need to store every loc on two variables after finish loop
this.partDetailsService.getLocationData(locationArr).subscribe(res => {
console.log(res);
res.forEach((item, index) => {
let dataLocation = res[index]['_source']['GPS1'];
console.log(dataLocation);
let loc = dataLocation.split(',');
console.log("After");
console.log(loc); success
console.log(loc[0].trim()); success
console.log(loc[1].trim()); success
});
latitude= result of loc[0].trim after loop finish
longitude= result of loc[1].trim after loop finish
and what datatype assigned to two variables ?