code: function replaceSubKeyFromList(list, sub, key, value, object) {
      for (var i = list.length - 1; i >= 0; i--) {
          if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == value)) {
              return list.splice(i, 1, object); // remove from array and replace by the new object
          }
      }
      return false;
  }
docs: Replace in list the last object having the same sub.key attribute as value
  
  @param list Array of objects having sub.key attribute comparable to value
  @param {string} sub
  @param {string} key
  @param value
  @param object New object replacing the old one
  @return {*} Array of replaced item or false