This is an array,
total = [\"10%\", 1000, \"5%\", 2000] . how can i filter these into two array like, percentage = [\"10%\",\"5%\"] and absolute = [100
You can use Array#reduce to split the array:
const total = ["10%", 1000, "5%", 2000];
const { absolute, percentage } = total.reduce((arrs, item) => {
const key = typeof item === 'number' ? 'absolute' : 'percentage';
arrs[key].push(item);
return arrs;
}, { percentage: [], absolute: [] });
console.log(absolute);
console.log(percentage);