Creating a comparison system using pure JavaScript without external databases

I’m working on a web project where I need to build a simple comparison tool using only HTML and JavaScript. I can’t use any external databases like MySQL or similar solutions.

Here’s what I’m trying to achieve:

const userGroups = {
  'Alice': 'Team A',
  'Bob': 'Team A', 
  'Sarah': 'Team B',
  'Mike': 'Team B'
};

I want to create three input fields where users can enter names. When someone types a name in the first input field and another name in the second field, the third field should automatically show TRUE if both people belong to the same team, or FALSE if they’re from different teams.

For instance, if I enter ‘Alice’ in field one and ‘Bob’ in field two, the result should be TRUE since both are in Team A. But if I enter ‘Alice’ and ‘Sarah’, it should show FALSE because they’re in different teams.

How can I implement this logic using only client-side JavaScript?