Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get key for value javascript

const findingKey = (obj , value) => (Object.keys(obj).find(key => value === obj[key]))
console.log(findingKey({id:"123",name:"Alice"},"Alice");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #key #javascript
ADD COMMENT
Topic
Name
9+1 =