js get item from object by key code example
Example 1: js find key by value in object
Object.keys(object).find(key => object[key] === value)
Example 2: javascript object get value by key
var obj = {
a: "A",
b: "B",
c: "C"
}
console.log(obj.a); // return string : A
var name = "a";
console.log(obj[name]);