I have an array of users. Each of these user have some context, but also some functions.
Normally, to delete one of these users, one could use users.splice(index, 1) with index being the index of interest.
However, I want to add a function remove() to each of these users, and then want to remove them by simply invoking user.remove() and this should remove the user from users.
Could this be done?
user.removeFrom(users). That makes it more reusable, and more explicit.