Practicing with loops, arrays and strings in JavaScript