I'm using playgrounds to learn Swift and I noticed something strange when trying to set optionals on var and let. Below is the code with output:
var num1: Int?
print(num1) //Output: "nil\n"
let num2: Int?
print(num2) //Output: Error: Constant num2 used before initialized
I do not understand why 'var' gets initialized with nil and 'let' is uninitialized when made optional.