Skip to content

Commit

Permalink
sentence amount
Browse files Browse the repository at this point in the history
fe fpeahdngsd ghpsgprw
  • Loading branch information
BurdenOwl authored Nov 2, 2024
1 parent bd5b3bf commit a91725c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ var wordCount = function () {
count = 0;
}
;
var display = document.getElementById('countDisplay');
display && (display.innerHTML = "Current Word Count: ".concat(count));
var sentenceAmount = (inputValue.match(/\./g) || []).length;
var displayWords = document.getElementById('countDisplay');
displayWords && (displayWords.innerHTML = "Current Word Count: ".concat(count));
var displaySentence = document.getElementById('sentenceDisplay');
displaySentence && (displaySentence.innerHTML = "Current Word Count: ".concat(sentenceAmount));
};
wordCount();
9 changes: 7 additions & 2 deletions scripts/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ const wordCount = (): void => {
count = 0;
};

const display = document.getElementById('countDisplay') as HTMLElement | null;
display && (display.innerHTML = `Current Word Count: ${count}`);
const sentenceAmount : number = (inputValue.match(/\./g) || []).length;

const displayWords = document.getElementById('countDisplay') as HTMLElement | null;
displayWords && (displayWords.innerHTML = `Current Word Count: ${count}`);

const displaySentence = document.getElementById('sentenceDisplay') as HTMLElement | null;
displaySentence && (displaySentence.innerHTML = `Current Word Count: ${sentenceAmount}`);
};

wordCount();

0 comments on commit a91725c

Please sign in to comment.