In the previous section, we added functionality to load up a sample model. Now we can add the functionality to the next button to delete a random member.
To delete a random member, we'll need to get all the member IDs. Then pick a random index, pull out the ID at that index and then delete the member.
Member IDs aren't always guarenteed to be in an ascending order from 1. In fact they most likely won't be.
If we were to pick a random number between 1 and the amount of members, and tried to delete the member with that ID, then it is likely to fail.
This is pretty straight forward code so let's add it to our
Looking good, build and test your app. You should be able to click the button until there are no more members, then click the Load Sample Model to restore the model.
If the App appears to lag severly, try closing the developer tools. This is a common issue with Google Chrome.
The App is starting to come together! In the next section, we'll look at creating a function to mimic a contruction sequence.