let e: String? = "novel"
guard let f = e
else { return }
print(f)
i got error like below if I code like above
Playground execution failed:
error: dotinstall.playground:175:12: error: return invalid outside of a func
else { return }
I wanna use "guard let syntax " without "func()"
I tried it in some ways, but its wasn't worked well.I know almost the "guard let syntax " usually used with "func()". But if I try it with "if let syntax " it was worked without error like below
let S: String? = "jjjj"
if let Thailand = S {
print(Thailand)}
please show me how can I code with "guard let" without "func()"