Skip to content

Instantly share code, notes, and snippets.

@agustinpfs
Created June 12, 2020 11:49
Show Gist options
  • Save agustinpfs/402396043675b0a6c5abb47004131e07 to your computer and use it in GitHub Desktop.
Save agustinpfs/402396043675b0a6c5abb47004131e07 to your computer and use it in GitHub Desktop.
Javascript básico. Arreglos (arrays)
numeros = [1, 2, 3, 4, 5, 6, 7, 8, 9]
texto = ["perro", "gato", "caballo"]
mix = [1, "casa", "auto", 77 ]
// Sus índices comienzan en 0 y se invocan con el nombre de la variable seguido del número de la posición entre corchetes.
console.log(numeros[1]) // 2
console.log(texto[0]) // perro
console.log(mix[3]) // 77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment