I am working with a JSON object and encountering an issue.
alert(typeof object)
//Output
Object
Upon using the JSON.stringify method, I receive the following string:
alert(JSON.stringify(object));
//Output object
[{
"locationId":"8",
"locationTypeId":"0",
"locationTitle":"Alberta Prices",
"locationAddress":"Alberta, Canada",
"locationStatus":"0",
"locationLatitude":"53.9332706",
"locationLongitude":"116.5765035",
"googleLocationId":"ChIJtRkkqIKyCVMRno6bQJpHqbA",
"lastModified":"2017-06-04 03:59:02",
"locationType":"SPORT",
"userId":"4"
}]
However, when attempting to access any property of the object, it returns 'Undefined';
alert(object.locationId);
//Output
Undefined