JSFiddle - React, Tailwind, and code Playground
by ChrisStanyon
JavaScript
// This is the data you get from your text input - it MUST be valid JSON
const value = '[{"type_point":"Insurance Company","name":"Park","location_latitude":"34.0483"},{"type_point":"Insurance Company","name":"Park","location_latitude":"33.96466"},{"type_point":"Insurance Company","name":"Park","location_latitude":"33.45068"}]'
// convert the string to an array of Objects
let markerObjs = JSON.parse(value)
// Create a new object and set the value of Marker to the pervious array
let markersData = {
Marker : markerObjs
}
// loop over the data
for (var key in markersData) {
markersData[key].forEach(function (item) {
console.log(item.location_latitude)
})
}