When i open the site, my browser crashes


Hi guys, i was on the challenge Slasher Flick, when i clicked on “Run tests (ctrl + enter)”, my browser tab stopped working. I tried to clean cache, use another browser, go to main page of the site, but when i go to the challenge, it always crashes! (I’m not clicking on Run challenge, it just crashes on this challenge.)

And i know there are some loop protection, i didn’t used //noprotect line. :confused:

Print of the code:

  1. For your for loop, change i = 1 to var i = 0
  2. When you are trying to slice off an array, the requirement in the .slice() has to be a number, but in the slasher challenge, I think there are certain examples where the array contain words instead of numbers, so that causes an error to the page
  3. Also, you shouldn’t do howMany + i, because in certain examples, the sum of howMany + i would be greater than the actual array length, and you can’t slice that off an array.
    You can check this video out for a different solution to this challenge: https://www.youtube.com/watch?v=Gn4esq98AmI



As people have mentioned above, you’ve run into an infinite loop.

As an aside, I think you’ve over complicated the challenge. Try re-reading the MDN documentation from the link supplied: Array.slice()

The solution is a lot easier than you think :wink: (I think Elisa provided a YouTube link to the solution)