Finding common pattern in array elements with duplicate value

Viewed 61
var session1 = [{event:"login"},{event:"selectcatagory"},{event:"buttonclicktoslectaproduct"},{event:"buttonaddtocart"},{event:"buttonpay"},{event:"logoutbutton"},{event:"destroy"}];
var seesion2 = [{event:"login"},{event:"search-input"},{event:"press-search-button"},{event:"buttonclicktoslectaproduct"},{event:"buttonaddtocart"},{event:"buttonpay"},{event:"logoutbutton"},{event:"destroy"}];
var seesion3 = [{event:"login"},{event:"selectcatagory"},{event:"buttonclicktoslectaproduct"},{event:"buttonaddtocart"},{event:"buttonpay"},{event:"logoutbutton"},{event:"destroy"}];
var seesion4 = [{event:"login"},{event:"selectcatagory"},{event:"buttonclicktoslectaproduct"},{event:"buttonaddtocart"},{event:"buttonpay"},{event:"logoutbutton"},{event:"destroy"}];
var seesion5 = [{event:"login"},{event:"selectcatagory"},{event:"buttonclicktoslectaproduct"},{event:"buttonaddtocart"},{event:"buttonpay"},{event:"logoutbutton"},{event:"destroy"}];
var seesion6 = [{event:"login"},{event:"search-input"},{event:"press-search-button"},{event:"buttonclicktoslectaproduct"},{event:"buttonaddtocart"},{event:"buttonpay"},{event:"logoutbutton"},{event:"destroy"}];
var seesion7 = [{event:"login"},{event:"search-input"},{event:"press-search-button"},{event:"buttonclicktoslectaproduct"},{event:"buttonaddtocart"},{event:"buttonpay"},{event:"logoutbutton"},{event:"destroy"}];

I have this arrays of different sessions from a web application.In this arrays, {event:"buttonclicktoslectaproduct"},{event:"buttonaddtocart"},{event:"buttonpay"},{event:"logoutbutton"},{event:"destroy"} this values are common and they have same order.I want to find this similar values with same pattern from those arrays and put them in a new array by javascript.I can loop over the arrays and find the duplicate value by myself.But I can not find the pattern.It can be thousands of arrays,So I can not check them manually.

0 Answers
Related