Hello @ameenarab5! You can always test your code by putting any data you like, but to pass the test, you need to have the code freeCodeCamp provides. If you want to play with your code, edit it and put in the data you want and then before clicking “Run Tests”, reset the code and do what’s said in the challenge, and then submit it.
The use cases of those functions are mostly for automated tasks. For example, you may want to have the data inside the array to be an user input. So, you would create a function so that when the user fills in the data and then hits the submit button, change or update the data of the array. So, I think those functions are used for those use cases. Maybe there’s more.