Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function towns (townArr) {
- for (let town of townArr) {
- let [name, latitude, longitude] = town.split(' | ');
- let currentObj = {};
- currentObj.town = name;
- currentObj.latitude = Number(latitude).toFixed(2);
- currentObj.longitude = Number(longitude).toFixed(2);
- console.log(currentObj);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement