Try Documentalist, my app that offers fast, offline access to 190+ programmer API docs.


class Counters {
	reset() {
		const keys = Object.keys(this);
		for (let i = 0; i < keys.length; i++) {
			const key = keys[i];
			this[key] = 0;
		}
	}

	inc(key) {
		if (!this[key]) {
			this[key] = 1;
		} else {
			this[key] = this[key] + 1;
		}
	}

	print() {
		const keys = Object.keys(this);
		for (let i = 0; i < keys.length; i++) {
			const key = keys[i];
			const v = this[key];
			console.log(`${key}: ${v}`);
		}
	}
}

export const counters = new Counters();

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:

Need fast, offline access to 190+ programmer API docs? Try my app Documentalist for Windows