Created
October 7, 2018 16:56
-
-
Save yunustek/ec055f9a0cdb5557eb420e95343ebf9b to your computer and use it in GitHub Desktop.
shuffle()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var names = ["Alejandro", "Camila", "Diego", "Luciana", "Luis", "Sofía"] | |
names.shuffle() | |
//names == ["Luis", "Camila", "Luciana", "Sofía", "Alejandro", "Diego"] | |
let numbers = 0…9 | |
let shuffledNumbers = numbers.shuffled() | |
// shuffledNumbers == [1, 7, 6, 2, 8, 9, 4, 3, 5, 0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment