Add item to dictionary

 Problem

I have a Dictionary and want to add a new key-value pair.



 Recipe


// Initialize the Dictionary
var dict = ["name": "John", "surname": "Doe"]
 
// Add a new key with a value

dict["email"] = "john.doe@email.com"

print(dict)
				


 Playground