DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
find in highest value key from an object javascript
var obj = {a: 1, b: 2, undefined: 1}; Object.keys(obj).reduce((a, b) => obj[a] > obj[b] ? a : b);
Source by www.reddit.com #
PREVIOUS
NEXT
Tagged:
#find
#highest
#key
#object
#javascript
ADD COMMENT
Topic
COMMENT
Name
3+9 =
Submit