js entries

JavaScript
Object.entries(obj).forEach(([key, value]) => {
	console.log(key, value);
});const object1 = {
  a: 'somestring',
  b: 42
};

for (let [key, value] of Object.entries(object1)) {
  console.log(`${key}: ${value}`);
}

// expected output:
// "a: somestring"
// "b: 42"
// order is not guaranteedObject.keys(object).find(key => object[key] === value)// For a functional one-liner
Object.keys(pokemons).forEach(console.log);
// Bulbasaur
// Charmander
// Squirtle
// Pikachuconst object1 = {
  a: 'some string',
  b: 42
};

for (let [key, value] of Object.entries(object1)) {
  console.log(`${key}: ${value}`);
}

// expected output:
// "a: some string"
// "b: 42"
// order is not guaranteedconst object1 = { a: 'somestring', b: 42 };
for (const [key, value] of Object.entries(object1)) {
  console.log(`${key}: ${value}`);
} // expected output: "a: somestring" "b: 42" order is not guaranteed
Source

Also in JavaScript: