Hi there,
I’m at the third exercise of Test Your Skills: Array.
After checking @chrisdavidmills github answer, I find out I was going the wrong way by not using .forEach
method.
Instead, I was trying to use the .splice
like this:
for (let i = 0; i < myArray.length; i++) { let arr = myArray.splice(1, 0, myArray.indexOf(i)); }
Unfortunately, my tab froze at the moment I enter the code, and I’m not able to test it (tried on Firefox and Chrome)!
Could somebody tell me if this method is working as well?
Thanks a lot!