like traversing an array and replacing or deleting elements in javascript

0

A question how can I go through this array and delete all the commas (,) that I find in the value, I want to send that array from ajax to php and then send it to the database and I want to eliminate the comma (,). Thank you very much for the answers.

  var formulario = $("#venta").serializeArray();

  console.log(formulario)

the result in the console is as follows

[ 0: {name: "fecha-venta", value: "2018-11-09"} 1: {name: "id_venta", value: "54"} 2: {name: "efectivo-venta", value: "800,000"} 3: {name: "inversion-venta", value: "200,000"} 4: {name: "gastos-venta", value: "40,000"} ]

    
asked by jhon sanchez 10.11.2018 в 01:21
source

1 answer

1

You can go through and separate like this:

var x = $("#venta").serializeArray();
    $.each(x, function(i, field){
        $("#results").append(field.name + ":" + field.value + " ");
    });
    
answered by 10.11.2018 / 01:53
source