Write the definition of a function named counter that receives no parameters and returns 0 the first time it is invoked, returns 1 the next time it is invoked, then 2, 3 and so on.