I am trying to split a string based on 2 delimiters
let text = "How are you doing AND today OR yesterday?";
const myArray = text.split('AND|OR');
console.log(myArray)
But the above does not work How can I do that?
You could take a regular expression with an alternative.
let text = "How are you doing AND today OR yesterday?";
const myArray = text.split(/AND|OR/);
console.log(myArray)