document.getElementById("comparable").addEventListener("click", mayor);
function mayor() {
var numeros = [],
ingresar = prompt('Ingresa los números, separados por comas', ''),
j = 0;
var c = ingresar.replace(new RegExp(',', "gi"), " ").split(" "),
var v = c.length;
for (; j < v; j++) {
}
}
<input type="button" id="comparable" value="Comparar" />
So far, I receive the numbers in función
, I remove the coma
and I put them in array
. Then my idea is recorrerlo
and the ** largest of all will be returned , but how do I verify the largest one in a cycle for ?