let variables= Object.keys(this.state.variables); //this contains an array like so ["aab","abb","acc"];
const operations=["+","-","*","/",".","(",")"];
const numbers=[0,1,2,3,4,5,6,7,8,9];
let allOfThem=[...variables,...operations,...numbers];
let checker = value =>allOfThem.some(element => value.includes(element));
newArr=string.split(""); // <= doesn't make sense, huh?
console.log(newArr.filter(checker));
I am not getting anything from the filter.
The main issue is the length of the variables I can split the string using .split(“”) because the variables have a length longer than 1.