Insert in combined array creates empty rows?? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Insert in combined array creates empty rows??

see my code 7zottenARR. My attempt to insert on position 14 of the combined array results in a few empty rows at the end of the array followed by the last 2 fields. Why does this happen? tnx https://code.sololearn.com/cm80kWDg4gcp/?ref=app

14th Nov 2017, 7:52 PM
Dieter Decapmaker
Dieter Decapmaker - avatar
2 Antworten
+ 1
I've changed the "puts" in the end to "print" so this is how your array really looks like: [[7, "zotten", "zwommen", 7, "zonnige", "zondagen", "zonder", "zwarte"], ["zwembroek", "ze", "zijn", "ZOT", "zei", "Zulma"], "ze", "zullen", "ziek", "zijn"] You have: pos 0 nested array pos 1 nested array pos 2-5 strings Is that what you aimed for?
14th Nov 2017, 8:00 PM
Uria
0
print would have immediately visualized what I overlooked: the nested arrays and pos counting... thanks a lot!
14th Nov 2017, 8:09 PM
Dieter Decapmaker
Dieter Decapmaker - avatar