MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / constructor

Method constructor

assets/js/wordCounter.js:3–8  ·  view source on GitHub ↗
(inputText)

Source from the content-addressed store, hash-verified

1//word conter class
2class WordCounter {
3 constructor(inputText) {
4 this.inputText = inputText;
5 this.inputText.addEventListener("input", () => {
6 this.count();
7 });
8 }
9 count() {
10 let wordStat = this.getWordStat(this.inputText.value.trim());
11 this.emitEvent(wordStat);

Callers

nothing calls this directly

Calls 1

countMethod · 0.95

Tested by

no test coverage detected