I am showing an array from javascript using the following for
:
for (var y = 0; y < arrayHay.length; y++) {
$(".reporteBody").append('<div class="cajaResult"><h3>Caja #' + arrayHay[y] + "</h3><p>" + arrayMaximo[y] + "</p></div>");
}
Which shows it to me like this:
How can I show the same array only with a hyphen instead of the comma?
Thank you very much for the help.
EDITED
I'm dealing with the following form and I still do not care about the commas:
for (var y = 0; y < arrayHay.length; y++) {
str = arrayMaximo[y].toString();
str.replace(",", "-");
console.log("Cadena nueva:", str);
$(".reporteBody").append('<div class="cajaResult"><h3>Caja #' + arrayHay[y] + "</h3><p>" + str + "</p></div>");
}