Is there any ways to split an array of string in JavaScript based on multiple values.
var inputArray = ["[dim].[att].&[1]","[dim].[att].&[2]","[dim2].[att2].&[2]","[dim].[att].[All].Children","[dim4].[att5].[All].Children", "[m1].[123]", "[m1].[m4]"];
var splitBasedOn = `[".&",".[All].Unknown",".[All]", "."];`
so I want to split values in inputArray
, based on values in splitBasedOn
array.
I will first split on first value in splitBasedOn array then I will try to split based on second value in splitBasedOn and so on.
Without using multiple for loops how can I acheive desired result.