I have worked with Python in the backend and plain HTML in frontend. Once the data retrieved from JSON file, an object is created using them and appended to an array to send to the frontend.
Backend with Python
def unpack_coordinates(coordinates):
coordinates_list = list()
for item in coordinates[0]:
coordinates_list.append({'lat': item[1], 'lng': item[0]})
return coordinates_list
However, when checking the array in the frontend side I found & #39; added in the array.
What I got in the frontend
[{'lat': 43.770625433748776, 'lng': -79.3998992207101}, {'lat': 43.770651091617324, 'lng': -79.39977945240246}, {'lat': 43.77046066096583, 'lng': -79.39970177723474}, {'lat': 43.77043500133246, 'lng': -79.39982154480901}, {'lat': 43.770625433748776, 'lng': -79.3998992207101}]
I want to remove & #39; from the array. Is there any way to do it?
What I expected
[{'lat': 43.770625433748776, 'lng': -79.3998992207101}, {'lat': 43.770651091617324, 'lng': -79.39977945240246}, {'lat': 43.77046066096583, 'lng': -79.39970177723474}, {'lat': 43.77043500133246, 'lng': -79.39982154480901}, {'lat': 43.770625433748776, 'lng': -79.3998992207101}]
Or
[{lat: 43.770625433748776, lng: -79.3998992207101}, {lat: 43.770651091617324, lng: -79.39977945240246}, {lat: 43.77046066096583, lng: -79.39970177723474}, {lat: 43.77043500133246, lng: -79.39982154480901}, {lat: 43.770625433748776, lng: -79.3998992207101}]