Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7538337
fibonacci_tco.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
318 B
Referenced Files
None
Subscribers
None
fibonacci_tco.js
View Options
function
fib
(
n
,
a
=
0
,
b
=
1
)
{
if
(
n
===
0
)
return
a
;
return
fib
(
n
-
1
,
b
,
a
+
b
);
}
const
start
=
performance
.
now
();
const
result
=
fib
(
35
);
const
end
=
performance
.
now
();
console
.
log
(
`fibonacci(35) =
${
result
}
`
);
console
.
log
(
`Time:
${
(
end
-
start
).
toFixed
(
4
)
}
ms (
${
((
end
-
start
)
*
1000
).
toFixed
(
2
)
}
µs)`
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 17, 12:56 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
555012
Default Alt Text
fibonacci_tco.js (318 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment