oschvr

a blog about software, programming, business, travelling and life.

← Posts

Shortest Fibonacci

Shortest Fibonacci

11 days ago

 15/05/2019

Here's an incredibly short anonymous fibbonaci function in Js.

It takes a parameter n to calculate the fibonacci number at position n

1
(n => n <= 1 ? n : n-1 + n-2)(5);

Comments

Send