Get the largest value from Json object with Javascript

Posted by neilc on Stack Overflow See other posts from Stack Overflow or by neilc
Published on 2010-04-12T09:19:27Z Indexed on 2010/04/12 9:23 UTC
Read the original article Hit count: 354

Filed under:
|
|

Hi

This should be an easy one. I just cant figure it out.

How do I get the largest value from this piece of JSON with javascript.

{"data":{"one":21,"two":35,"three":24,"four":2,"five":18},"meta":{"title":"Happy with the service"}}

The key and value I need is:

"two":35 

as it is the highest

thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about JSON