Answer the question
In order to leave comments, you need to log in
How to make such a block output?
Tell me how to implement this:
Or poke, please, into the site where this is implemented.
Thank you!
Answer the question
In order to leave comments, you need to log in
You have not described the case when the letter is a consonant, respectively, the function is called 1 time if the first letter is a consonant. Well, you need to return the result of a function call in order to get recursion. Something like this (can and should be optimized)
function getCount(str, i, counter = 0) {
if (i >= str.length) return counter;
if (['a', 'e', 'i', 'o', 'u'].indexOf(str[i]) != -1) {
return getCount(str, ++i, ++counter)
}
return getCount(str, ++i, counter);
}
It's very simple, floating blocks with padding, here is an example jsfiddle.net
Wrapping can be specified using the :nth-of-type(2n) and :nth-of-type(2n+1) pseudo-selectors
output 2 records
then output the other 2 with other css classes
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question