The below function calculates the Fibonacci, why the last calculation needs to include the function name and not just (n-1)+(n-2) ?
function fibonacci(n){
if (n===1){ return 1}
else if (n===0){ return 0}
else return fibonacci(n-1)+fibonacci(n-2) // (n-1)+(n-2) does not work. Why?
}
I know this is a beginner question but couldn't find the answer. I'd appreciate any comments. I understand that I need to use recursion, but that's not the point of my question.