convertListToDictUsingKV = (keyName, keyValue, list) => {
  // if the list has more than one object then reduce it.
  return list.length > 1
    ? list.reduce((prev, next, index) => {
      // Initial object for the list.
      if (index === 1) {
        const newObj = {};
        newObj[prev[keyName]] = prev[keyValue];
        newObj[next[keyName]] = next[keyValue];
        return newObj;
      }
      // Other objects for the list.
      prev[next[keyName]] = next[keyValue];
      return prev;
    })
    : (() => {
      return list.length <= 0
        ? {}
        : (() => {
          const newObj = {};
          newObj[list[0][keyName]] = list[0][keyValue];
          return newObj;
        })();
    })();
}
Return a list with object to bunch {keyName: keyValue}.
@param  {String} keyName  the name of the key which is present in [{object}].
@param  {String} keyValue the value of the given key in [{object}].
@param  {Array[Object]} list     the list of objects
@return {Object}          the {key, value} pairs.