How to store values of loc[0] and loc[1] on two variables latitude and longtude
and what type of two variables ?
- 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
- });
longtude= result of loc[1].trim after loop finish
and what datatype assigned to two variables ?

Piyush PansuriyaRank #454 · 5.5K reputationPosted Dec 30, 2019, 1:25 AM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Dec 30, 2019, 1:36 AM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Dec 30, 2019, 1:40 AM EST
Piyush PansuriyaRank #454 · 5.5K reputationPosted Dec 30, 2019, 1:41 AM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Dec 30, 2019, 1:43 AM EST
ahmed elbarbaryRank #1,060 · 1.8K reputationPosted Dec 30, 2019, 1:52 AM EST
Piyush PansuriyaRank #454 · 5.5K reputationPosted Dec 30, 2019, 1:57 AM EST