Skip to content

Instantly share code, notes, and snippets.

@ByCharliee
Created February 24, 2021 23:07
Show Gist options
  • Select an option

  • Save ByCharliee/7a8284a96d4fd04a85d457010fe3c9ee to your computer and use it in GitHub Desktop.

Select an option

Save ByCharliee/7a8284a96d4fd04a85d457010fe3c9ee to your computer and use it in GitHub Desktop.
const numeros = [3, 4, 6, 7];
let i = numeros[0];
let j;
let valor = false;
numeros.forEach(function(numero){
if(numero == i){
console.log(numero);
console.log(i+"\n\n");
i++;
}
else{
valor = true;
j=i;
}
}
);
if(valor){
console.log(j);
}
else{
console.log(i++);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment