How do i define the fib() function, which returns the next Fibonacci number after each call?

Define the fib() function, which returns the next Fibonacci number after each call.
The solution should inject only the name of the fib function into the global scope and not create additional properties of the fib function or its properties.

I need the help by using JavaScript, I’m troubling with the solution..