Skip to content
Advertisement

Print 5 items in a row on separate lines for a list?

I have a list of unknown number of items, let’s say 26. let’s say

JavaScript

How to print like this:

JavaScript

? Thank you very much. Attempt:

JavaScript

Advertisement

Answer

It needs to invoke for-loop and join functions can solve it.

JavaScript

Demo:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement