Object.fromEntriesbeginner// Build an object from [key, value] pairs
const entries = [['a', 1], ['b', 2]]
Object.fromEntries(entries) // β { a: 1, b: 2 }Use Object.fromEntries() to convert an iterable of [key, value] pairs into a plain object.
Object.fromEntries(Object.entries(obj)) creates a shallow clone of obj. This demonstrates the inverse relationship.
Challenge: Implement roundTrip(obj) that does Object.fromEntries(Object.entries(obj)).
roundTrip({ a: 1, b: 2 }) // β { a: 1, b: 2 }