I am currently struggling with a question and unsure of what to do, so I am seeking help to solve the following challenge:
- Begin by creating an empty array.
- Next, create a function that takes in one argument.
- Within this function, add the argument to the previously created array.
- Lastly, call the function and pass in a value of any type.*
To define an empty Array you can use:
const emptyArray = []
A simple function with 1 argument would look like this:
function oneArgument(argument) {}
The task "Inside the function, add the argument to the array" is where I'm encountering difficulty. Can someone explain what this step entails?
Finally, it seems that completing the process involves simply assigning a value to oneArgument(someValue)
.
Any assistance on this matter would be greatly appreciated :)