3 ms·
On the front page, there is an example about optional typing, but it's not very clear how the typing is coming in: def fib(x) { x <= 2 ? 1 : fib(x - 1) + fib
by arunix 28d ago
On the front page, there is an example about optional typing, but it's not very clear how the typing is coming in:
def fib(x) { x <= 2 ? 1 : fib(x - 1) + fib(x - 2) }
println "40th fibonacci number is ${fib(40)}"