This is an array,
total = [\"10%\", 1000, \"5%\", 2000] . how can i filter these into two array like, percentage = [\"10%\",\"5%\"] and absolute = [100
total = [\"10%\", 1000, \"5%\", 2000]
You can use regular expressions since you have only strings in your array.
For % :
total.filter(function(element){ return /^[0-9]+\%$/gi.test(element); });
For absolute :
total.filter(function(element){ return /^[0-9]+$/gi.test(element); });