Valores en reversa dentro de un array / Reversing the values in an array

var animalArray: [String] = ["Dog", "Cat", "Fish", "Owl" ] animalArray.reverse() //The array values are now ["Owl", "Fish", "Cat", "Dog"] /*Create a new array from the reversed values*/ var animalArray: [String] = ["Dog", "Cat", "Fish", "Owl" ] let newArray = animalArray.reverse() //The newly created array contains ["Owl", "Fish", "Cat", "Dog"]

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.