There is a 2 dimensional array:
let userGroup = [
['user1-', 'user2-', 'user3-'],
['user4-', 'user5-', 'user6-'],
['user7-', 'user8-', 'user9-']
];
How to make a single array from it and delete the symbol "-" after each element?
So the output will be: ['user1, 'user2', 'user3', 'user4', 'user5', 'user6', 'user7', etc...]
And also how to write a code which will do the same but with any number of inner arrays? For example if the "userGroup" array had more unexpected inner arrays with more users (['user11', 'user12', 'user13] etc.), what is the way to write a function which take the "userGroup" array and will do the same (delete the last element "-" in each element and combine all the elements in inner arrays into one array)?