lib/sugar.js
/*
  This function receives an object and will return a new object with the keys and values inverted. See the tests for examples of this.
*/
This function receives an object and will return a new object with the keys and values inverted. See the tests for examples of this.
This function receives an object and will return a new object with the keys and values inverted . See the tests for examples of this .
function invert(object) {
  const invertedObj = Object.fromEntries(
    Object.entries(object).map(([key, value]) =>  [value , key]));
    return invertedObj;
}
function invert ( object ) { const invertedObj = Object . fromEntries ( Object . entries ( object ) . map ( ( [ key , value ] ) => [ value , key ] ) ) ; return invertedObj ; }
This function receives an object and will return a new object with the keys and values inverted.
This function receives an object and will return a new object with the keys and values inverted .
//used entries to get the keys and values and return them swapped around 