# Fibonacci sequence - position

I search something about recursionl, in particular Fibonacci sequence and I see this example:

``````var fibonacci_series = function (n)
{
if (n===1)
{
return [0, 1];
}
else
{
var s = fibonacci_series(n - 1);
s.push(s[s.length - 1] + s[s.length - 2]);
return s;
}
};

console.log(fibonacci_series(8));
``````

and I don’t understand what means` s[s.length -1]` and `s[s.length-2]`, I mean they represent the positions or other things.
If it presents the positions which one does it take?
Or there’s something that escapes me and I can’t see.
P.S
I ask if there is any resource that explains it in a simple step by step manner.
Thanks,
CamCode

Not sure what you mean by “which one does it take”. `s[s.length - 1] ` and `s[s.length - 2]` are the last and 2nd to last elements in the `s` array. They get added together to become the next element (via the push method) in the `s` array.

When I looked at that line of code, I think this:
If i get for example 3 as parameter of function,
executes the function, arrives at the variable s,that recall function ,but
instead having 3 now I have 2 (if I do n -1),then it goes on until it reaches 1.
Arrived at the line `s.push(s[s.length - 1] + s[s.length - 2]);`
I had thought it was making the sum and add element in s.
(I don’t know if I’m thinking well here)