Skip to content

Instantly share code, notes, and snippets.

@fitomad fitomad/array_init.swift Secret
Created Nov 19, 2018

Embed
What would you like to do?
// Podemos crearlo vacío...
var inicio = [String]()
// ...repitiendo un mismo elemento un número determinado de veces...
var sheldonLlama = [String](repeating: "Toc", count: 3)
print(sheldonLlama)
print("Penny")
print(sheldonLlama)
print("Penny")
print(sheldonLlama)
print("Penny")
// O asignándole valores directamente.
var personajes = [ "Penny", "Leonard", "Sheldon", "Raj", "Howard" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.