I’ve been looking at simple JS exercises and I would appreciate it if you showed me how to approach this question or, even better, provide a solution that I can take a look at. Help much appreciated.
EDIT: I would also appreciate any simple working example of the function in use.
There’s no need to create a new function as one already exists:
Creating a new function is just extra overhead with no value added.