score:0

i hope i got the structure right, based on your last comment. i suggest creating a joint structure (e.g. joint array) of the two entities, which will be made of objects that have the props of user and also the two props "last used", "quarantined till" which will be taken from licensed users.

example of the joint structure: ("" used instead of actual data)

jointarr = [
  {
    user_name: "user 0",
    user_directory: "",
    assigned: "",
    display: "block",
    last_used: "",
    quarantined_till: "",
  },
  {
    user_name: "user 1",
    user_directory: "",
    assigned: "",
    display: "block",
    last_used: "",
    quarantined_till: "",
  },
  ...
  ...
];

in order to generate this structure, you will be iterating over users, while checking on licensed users if the current user belongs to that table as well:

const jointarr = [];

// users refers to users array
// licensedusers refers to licensed users array

users.foreach((user) => {
  const licenseduser = licensedusers.find(
    (lcuser) => lcuser.user_name === user.user_name
  );
  let lastused = "";
  let quarantinedtill = "";

  if (licenseduser) {
    lastused = licenseduser.last_used;
    quarantinedtill = licenseduser.quarantined_till;
  }

  jointarr.push({
    user_name: user.user_name,
    user_directory: user.user_directory,
    assigned: user.assigned,
    display: user.display,
    last_used: lastused,
    quarantined_till: quarantinedtill,
  });
});

Related Query

More Query from same tag