D
D
Dmitry Konovalov2015-08-30 20:37:29
JavaScript
Dmitry Konovalov, 2015-08-30 20:37:29

How to make such a block output?

Tell me how to implement this:
0be1c2a44708450c8a592e59fcccc129.png
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

5 answer(s)
M
Michael, 2019-03-15
@Worddoc

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); 
}

A
Alexey Zuev, 2015-08-30
@Sprime

Approximately such an adaptive option can offer

K
Kirill Turovnikov, 2015-08-30
@turovnikoff

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

L
LittleFatNinja, 2015-08-30
@LittleFatNinja

output 2 records
then output the other 2 with other css classes

J
javanub, 2015-08-30
@javanub

jsfiddle.net/oejarktg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question