I want to find a particular element from an array and remove all next elements from that particular array.
below is my code:
var data1 = [a,b,c,d,e,f,g,h];
var data2 = c; // this is element, that i want to find from data1 and
remove all next element i.e. d, e, f, g, h .
And I want output like: var res = [a,b,c];
Thanks,