1 tr
.util
.Fib = function () {
4 self
.sequence = function (length
) {
7 for (var i
= 2; i
< length
; i
++) {
8 result
[i
] = result
[i
-2] + result
[i
-1];
14 self
.sum = function (length
) {
15 if (length
=== 0) { return 0; }
16 if (length
=== 1) { return 1; }
18 return self
.sequence(length
+ 1).reduce(function (previous
, current
) {
19 return previous
+ current
;