Public
Edited
Feb 19, 2024
Paused
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fib(10)
Insert cell
fib = {
let stash = [0n, 1n];

return function (n) {
for (let i = stash.length; i <= n; i++) {
stash.push(stash[i - 1] + stash[i - 2]);
}
return {
n,
sequence: stash,
tail: stash[n] + ""
};
};
}
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more