155. create a count function

JavaScript
Is this helpful ?

easy  - accepted / - tried

Please create a function count(), when called it should return how many times it has been called, count.reset() should also implemented.

count() // 1
count() // 2
count() // 3

count.reset()

count() // 1
count() // 2
count() // 3

Let's try to solve this problem within 10 mintues.

Discuss(27)