Im getting a "is not a function" error, and i have no why is happening, the issue is how i resolve in this case.
I have a data that is received from the user has string, and after i receive the data i need to clean this data,(replace commas by dots and than convert to number). The problem is after is sent the data to the server and comes back this data keeps in the application and than comes back to the server, the problem is that since in the first time the data already been treated is passing by a .replace function, and than gives me the error. How could i avoid in the second situation pass from being cleaned the data?
Here is my function:
var myNewData = _.map(oldData).map(function(x){
return _.assign(x,{
value_price: x.value_price ? parseFloat(x.value_price.replace(",", ".")) : null
});
});