Instructor: I'm going to refactor out these buttons and move that behavior into these tabs. Something I'll need to do for that is to create an array of people. That's just objects of names, so Luke, an ID of 1, then Darth and Leia. Darth as an ID of 4, and Leia has an ID of 5.
Now I can pass these people into my tabs. I'll get rid of these. I can v4 on these tab items. I'll say person of people. I can key that against the person.ID, and the label will now be bound to person.name. Hit Save there, and there's no visual change, it's just updated to use my set of data.
In fact, let's throw in Yoda for good measure just to show him. 20 and Yoda. Now we have a Yoda tab. To make sure we load the right person, I'll have to map the active tab IDs to the IDs in our people. That'll look something like removing this .click and saying active tab map. This is the tab ID.
We want to select this .people tab ID.ID. This ID will find the person and .ID will find this ID. Now with that simple refactor, I hit Save and everything updated perfectly. Hit Darth, click Leia, click Yoda, and everything's working because I simply swapped that click stream for an active tab stream...