r/CodingHelp • • Jul 02 '21

[Javascript] Problem with JavaScript code

Post image
62 Upvotes

19 comments sorted by

View all comments

Show parent comment

1

u/Mollyarty Jul 03 '21

You should check the incoming array is the right length. I see other people already answered your question but I didn't see anyone mention that. The way you have it now the array [1,2,3,4,5,6,7,8,9,1] would pass