Swift - Variables and Constants
Consider the following Swift code:
typealias Coordinates = (x: Double, y: Double) let point: Coordinates = (x: 3.5, y: 7.2) print(point.x)
What will be the output when this code runs?
Consider the following Swift code:
typealias Coordinates = (x: Double, y: Double) let point: Coordinates = (x: 3.5, y: 7.2) print(point.x)
What will be the output when this code runs?
Coordinates represents a tuple with named elements x and y of type Double.point.x accesses the x value of the tuple, which is 3.5.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions