Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(args) {
- const townObject = {};
- args.forEach((town) => {
- const takeTown = town.split('|');
- const [townName, townLatitude, townLongitude] = takeTown;
- townObject.town = townName.trimEnd();
- townObject.latitude = Number(townLatitude).toFixed(2);
- townObject.longitude = Number(townLongitude).toFixed(2);
- console.log(townObject);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement