function fib(n){ if(n < 3){ return 1; } let p = 0, q = 1, r = 1; for(let i = 3;i <= n;i++){ p = q; ...