JSFiddle - React, Tailwind, and code Playground

by Fagner Brack

JavaScript

const response = JSON.stringify({
  locations: {
    Sydney: {
      latitude: '-33.865143',
      longitude: '151.209900'
    }
  }
});

const getLatitudeFrom = (response) => {
  const responseAsLiteral = JSON.parse(response);
  const value = responseAsLiteral.locations.Sydney.latitude;
	alert('The latitude of Sydney is ' + responseAsLiteral.locations.Sydney.latitude);
};

getLatitudeFrom(response);