Introduction
In this lab, we will explore how to invert an object's key-value pairs without mutating the original object. We will use the Object.keys()
method and Array.prototype.reduce()
to invert the object. Additionally, we will learn how to apply a function to the inverted keys and return an array of keys responsible for generating the inverted value.