Implement a JavaScript function that creates customizable counters.
Asked in Amazon frontend interviews