var myObj = {no:'u',my:'sql'} var keys = Object.keys(myObj);//returnes the array ['no','my'];
Object.values(obj)
// Get keys of a dictionary let dict = { a:1 , b:2 , c:3 } console.log( Object.keys(dict) ) // expected output : ['a', 'b', 'c']
function getKeyByValue(object, value) { return Object.keys(object).find(key => object[key] === value); }
Object.values(object1)
const person = { name: 'Bob', age: 47 } Object.keys(person).forEach((key) => { console.log(person[key]); // 'Bob', 47 });
var obj = { a: "A", b: "B", c: "C" } console.log(obj.a); // return string : A var name = "a"; console.log(obj[name]);