How to Create a Word Counter - JavaScript Project For Beginners

How to Create a Word Counter - JavaScript Project For Beginners

dcode

2 года назад

8,559 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@-ebtkarat411
@-ebtkarat411 - 05.02.2024 12:45

However, there's a small issue in your implementation. You're iterating over each character of the text and then counting the occurrences of that character in the entire text on each iteration. This approach doesn't accurately check for consecutive occurrences. function abscenceOfThreeConsecutiveCharacters(text) {
for (let i = 0; i < text.length - 2; i++) {
if (text[i] === text[i + 1] && text[i] === text[i + 2]) {
return false;
}
}
return true;
}

Ответить
@prizmic3448
@prizmic3448 - 19.09.2022 01:34

You are literally the reason my programming assignment will be at least partially correct. Otherwise, I am clueless with js lol

Ответить
@purvadicholkar8356
@purvadicholkar8356 - 03.09.2022 00:20

I learn more from one of your 30 minute videos' than in a whole 3 term course in grade 8. All hail the KING: Dcode!

Ответить
@renatajosipovic
@renatajosipovic - 18.04.2022 19:29

It was very helpful, thanks!😊

Ответить
@ManontheBroadcast
@ManontheBroadcast - 09.02.2022 23:52

I have rarely encountered labeled statements ( or even the continue keyword ) in any of the thousands of JavaScript tutorials out there ... thanks for your effort !

Ответить
@slackergeek2007
@slackergeek2007 - 04.02.2022 22:22

Would love to see a word counter that can be attached to both a regular input and textarea. And by attached I mean embedded in the field, not below it. Inputs are easy, but I am struggling with a textarea, especially when scrollbars become visible.

Ответить
@cryptoboy1461
@cryptoboy1461 - 30.11.2021 03:40

You can't be called dumb you are very smart!

Ответить
@burgasdragonheirsilentgods
@burgasdragonheirsilentgods - 29.11.2021 22:02

Great content and explanation sir as per usual

Ответить
@SvetaSveta-ms4hi
@SvetaSveta-ms4hi - 29.11.2021 21:59

Thanks a bunch! 🙏 Learned a lot.

Ответить
@DGronki
@DGronki - 29.11.2021 16:41

Remarks: use css variables to make some values consistent in css
better to use ?? where it is possible instead ||

Ответить