0
what is the simplest form to out pt this program
var yourself = { fibonacci : function(n) { if (n === 0) { return 0; } else if (n === 1) { return 1; } else { return this.fibonacci(n - 1) + this.fibonacci(n - 2); } } };
5 Respostas
+ 1
`window` is a native Javascript object, you don't need to define it, it's already available.
Yes that was ten, just a randomly picked number. You can use any number.
0
By calling the method?
window.onload=function()
{
console.log(yourself.fibonacci(10));
}
0
window is not defined
0
is this (10) as in ten
0
ok