I want to remove plus(+) sign and coma from a string. here is the code.
JavaScript
x
2
1
actualValue.push(parseFloat(wholeValues[i].replace(/,/g, '')))
2
Advertisement
Answer
You just need to replace twice.
JavaScript
1
3
1
const value = parseFloat(wholeValues[i].replaceAll(',', '').replaceAll('+', ''))
2
actualValue.push(value)
3