Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object get property with max value javascript

var obj = {a: 1, b: 2, undefined: 1};

Object.keys(obj).reduce((a, b) => (obj[a] > obj[b]) ? a : b);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #object #property #max #javascript
ADD COMMENT
Topic
Name
8+3 =