let condition = "[AccNum]==true&&[AccNum]==[ARID]&&[AccNum]==aaaa || [ARID]!=true&&[DOB]>[ARID] || [DOB]>bbb&&[DOS]>=[ARID]&&[DOS]<[Gender]&&[66642]<=cccc&&[66642] In (ddd,fff,ggg) || [FirstName] NotIn (hhh,jjj,kkk)&&[FirstName] StartsWith lll || [Gender] EndsWith mmm";
I am looking to divide this into an array like below,
let array = [ "[AccNum]==true","&&", "[AccNum]==[ARID]", "&&", "[AccNum]==aaaa", "||", "[ARID]!=true", "&&", "[DOB]>[ARID]", "||", "[DOB]>bbb", "&&", "[DOS]>=[ARID]", "&&", "[DOS]<[Gender]", "&&", "[66642]<=cccc", "&&", "[66642] In (ddd,fff,ggg)", "||", "[FirstName] NotIn (hhh,jjj,kkk)", "&&", "[FirstName] StartsWith lll", "||", "[Gender] EndsWith mmm" ]
The separators in the expression are "&&" and "||" and I want them included as keys in the array too.