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]
Make two arrays from one array by separating number and string using advance js.
let total = ["10%", 1000, "5%", 2000]; var percentage = total.filter(e => isNaN(e)); var absolute = total.filter(e => !isNaN(e)); console.log({percentage , absolute});