Published
Edited
Mar 12, 2021
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function IRRCalc(CArray, guest) {
let inc = 0.000001;
let NPV = 0;
do {
guest += inc;
NPV = 0;
for (var j = 0; j < CArray.length; j++) {
NPV += CArray[j] / Math.pow(1 + guest, j);
}
} while (NPV > 0);
//return guest * 100;
return guest;
}
Insert cell
Insert cell
function cumulativeSum(myarray) {
let newArray = [];
myarray.reduce(function(a, b, i) {
return (newArray[i] = a + b);
}, 0);
return newArray;
}
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