+ 1

Why doesn’t it work?

Tell me please how to make my code work? https://code.sololearn.com/WjnpmaGJ1GXN/?ref=app

14th Oct 2018, 2:47 PM
Никита Шиляев
Никита Шиляев - avatar
8 Réponses
+ 4
https://code.sololearn.com/W63PdQeIyIOw/?ref=app Никита Шиляев do you want something just like this? 🤓
19th Oct 2018, 9:56 PM
Roneel
Roneel - avatar
+ 15
Никита Шиляев My solution function func(sTring){ var z for (let i=1; i<=sTring.length; i++) { z=sTring.slice(1)+sTring.slice(0,1)+"<br>"; } document.write(z) } func("Hello");
14th Oct 2018, 4:10 PM
r8w9
r8w9 - avatar
+ 12
Никита Шиляев Code's name is sum arr but your code is not even close for something like that☺ Anyway logic behind your code is completely wrong. You cannot loop over undefined array length☺ What is your goal? Tell me and I'll try to help you.
14th Oct 2018, 3:43 PM
r8w9
r8w9 - avatar
+ 11
Никита Шиляев I don't understand,sorry
16th Oct 2018, 3:42 PM
r8w9
r8w9 - avatar
+ 1
r8w9, thank you for your answer! please dont pay attention to the title or comments above, I’m wondering to launch loop and function inside it. Take a look at this please)
14th Oct 2018, 3:55 PM
Никита Шиляев
Никита Шиляев - avatar
+ 1
yep, now it’s cool! thank you! Could you give me a hint how to apply this function to every subsequent iteration? like every next result should be the changed version of the previous one
15th Oct 2018, 5:07 AM
Никита Шиляев
Никита Шиляев - avatar
0
Roneel, exactly) thank you!
23rd Oct 2018, 8:22 PM
Никита Шиляев
Никита Шиляев - avatar
0
Thank you for ask
27th Nov 2018, 10:30 AM
Emmanuel Arthur
Emmanuel Arthur - avatar