Get array of keys in dictionary

 Problem

I have a dictionary and want to get an array of all its keys.



 Recipe


// Initialize the Dictionary
let dict = ["name": "John", "surname": "Doe"]
 
// Get array of keys

var keys = Array(dict.keys)
print(keys)

				


 Playground