I need help for y problem, assume the following array:
let arr = [1,2,3,"*" , 4, "*" , 7 , 8 ,9 ,"*", "10","11", "*", "12" , "*"];
I want to have an output like this:
first array [1,2,3], second array [4], third array [7,8,9] and so on.
I can find all the * with filter but after that I can slice just with indexOf and lastIndexOf to get the first and the last *.indexOf(filteredElement,2) I can't perform a search for * after specific number, because the user input of the * can be different.
Any suggestions?
Thanks in advance guys