I need to get a maximum amount to be able to work only on that amount. as I do?
function add() {
for (var i = 0; i < esto.length; i++) {
if(esto.length >= 15) { //De estos 15 necesito que obtenga 5 no más y poder trabajar en esa cantidad
}
}
}
If you refer to the first 5 you can evaluate the value of i of your for so that as soon as it is equal to 5 it closes the loop, while it is less than 5 you can add the values to another array.