Determine how many words have a string consisting of one, 2, 3, etc. characters
The easiest of course did, but something I do not understand how to count the number of words. You can of course do it with if, but you’ll get a Hindu code, which you don’t really want.
const str = 'текст тееекст тексты тееекст тееекст' const word = str.split(' ') for (const a of word) { console.log(a.length) }