I have an Array and want to delete X
element and All elements after 'X'
element in array and return previous elements
This is my array : ['A' , 'B' , 'C' , 'D' , 'X' , 'Z' , 'A' , 'B' , 'F']
And the new array I want is this : ['A' , 'B' , 'C' , 'D']
How can I did this?