Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 29, 2019 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a60e60c7b498b2991e2da222e62520ba to your computer and use it in GitHub Desktop.
Save parzibyte/a60e60c7b498b2991e2da222e62520ba to your computer and use it in GitHub Desktop.
let arreglo = [1, 2, 50, 1, 2, 3, 88, 45],
busqueda = 50;
console.log("Tenemos el arreglo: ", arreglo);
console.log("Buscando ", busqueda);
let indice = arreglo.indexOf(busqueda);
console.log("El elemento buscado está en el índice ", indice);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment