mapKeys
Maps the keys of an object using the provided function, generating a new object.
- Use
Object.keys()to iterate over the object's keys. - Use
Array.prototype.reduce()to create a new object with the same values and mapped keys usingfn.
Maps the keys of an object using the provided function, generating a new object.
Object.keys() to iterate over the object's keys.Array.prototype.reduce() to create a new object with the same values and mapped keys using fn.