renameKeys
Replaces the names of multiple object keys with the values provided.
- Use
Object.keys()in combination withArray.prototype.reduce()and the spread operator (...) to get the object's keys and rename them according tokeysMap.
Replaces the names of multiple object keys with the values provided.
Object.keys() in combination with Array.prototype.reduce() and the spread operator (...) to get the object's keys and rename them according to keysMap.