Published
- 1 min read
js get first object value
The solution for this is noted below
js get first object value
Solution
var obj = { first: 'someVal' }
obj[Object.keys(obj)[0]] //returns 'someVal'
Try other methods by searching on the site. That is if this doesn’t work