#3 Swift code refactor in action - a sneaky problem hidden in code snippet

Swift code refactor in action 👨🏻‍💻 Take a close look at the validate function. There&rsquo;s a sneaky problem hidden in this code snippet. What will the function call return when passed nil ? What problem is hidden here? First, the guard statement is redundant here. We can simplify the function to ⤵️ func validate (password: String?) -> Bool { password?.count ?? 0 > 8 } There&rsquo;s no need to…