Does undefined mean empty or am I making an error?

  • 1
  • Question
  • Updated 6 years ago
Hey,

I'm having a little bit of trouble retrieving high tide info for Wildwood NJ. I'm using javascript and my code looks like this :

var high_tide = parsed_json['tide']['tideSummaryStats']['maxheight'];

The only response I get is "undefined"

Does this mean there is no value for high tide in Wildwood NJ or am I doing something wrong in my code? Any help would be greatly appreciated!

Thanks!
Photo of mtuman1843

mtuman1843

  • 8 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1
Photo of mtuman1843

mtuman1843

  • 8 Posts
  • 0 Reply Likes
Ok so I modified it to:

var high_tide = parsed_json['tide']['tideSummaryStats']['0']['maxheight'];

and it works fine but I also want to grab the type (high tide). When I type var high_tide = parsed_json['tide']['tideSummary'][0]['data.type']; I'm back to getting undefined again. Can anyone point me in the write direction?

Thanks