Which programming language is this?
func divide(_ a: Int, by b: Int) -> Int? {
guard b != 0 else { return nil }
return a / b
}
let half = divide(10, by: 2) ?? 0
Answer: Swift
Unlike Kotlin, it uses
Play Programming Languages ▸
func, the _ and by argument labels, a -> Int? return arrow and guard ... else, which are Swift.