<script src="https://cdnjs.cloudflare.com/ajax/libs/collect.js/4.34.0/collect.min.js"></script>
<script>
const objCars = {
'reno': '$15000',
'audi': '$20000',
'bmw': '$30000',
'peogeot': '18000$'
}
const total = collect(objCars).sum(value => value.replace(/\D+/g, ''));
alert(total);
</script>
|