Here’s the problem we’re trying to solve. We have an array of users as follow: const users = [
{ firstName: 'Jane', lastName: 'Foo' },
{ firstName: 'John', lastName: 'Bar' },
{ firstName: 'Jill', lastName: 'Err' }
] Given a user, for example, John Bar, we want to re-arrange the…