Task

Write a function to detect a   divide by zero error   without checking if the denominator is zero.




func div_check(a, b){
    var result = a/b
    result.abs == Inf ? nil : result
}
 
say div_check(10, 2)  # 5
say div_check(1, 0)   # nil (detected)