Create a function named displayTotalCount
with two parameters:
- An array of strings.
- A new string element to be added to the list.
The displayTotalCount function should execute
the following tasks:
- Adds the string to the array.
- Display the total count of elements in the
updated array by logging it to the console.
Create a function removeLastMember
that takes an array of strings as a parameter.
The removeLastMember
function should
perform the following steps:
- Removes the last element from the array.
- Display the updated array by logging
it to the console.
Create a new function named calculateTotal
that accepts two arrays as parameters
and logs to the console, the total number
of elements in both arrays.
We are not displaying the answer for this exercise.
We do this because we want you to challenge yourself
and
not give in to the temptation of looking at the solution.
We also don't want to leave you stuck, so if you feel
you have tried enough and are still unable to solve
this exercise, feel free to ask in our community.
Here is the link to join the community.