Im using google api for generating places and maps. I have the json parsing code in php and i need it in javascript can someone help me with my code
<?php
$json_string = file_get_contents("https://maps.googleapis.com/maps/api/place/textsearch/json?query=pizza&sensor=false&key=MYKEY");
$parsed_json = json_decode($json_string);
$var = $parsed_json->{'results'}[0]->{'formatted_address'};
?>
so with [0] im referring to the first result, how can do it in javascript ?