R

Ravina • 2.56K Points
Extraordinary

Q. How do you define a dictionary in Swift?

  • (A) var dict = [String: Int]()
  • (B) dict = new Dictionary()
  • (C) dict = {String, Int}
  • (D) var dict = dict<String, Int>()
  • Correct Answer - Option(A)
  • Views: 1
  • Filed under category Swift (iOs)
  • Hashtags:

Explanation by: Ravina
Dictionaries in Swift are defined using `[KeyType: ValueType]()` syntax.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.