Skip to content
Advertisement

Problem: printing an index, value of index, length index in an array has a loop

JavaScript

Advertisement

Answer

The problem is that you are mixing i with max_box. The following should work as you expect:

JavaScript

Additionally, try to be explicit when naming your variables, max_L and max_box are not very good names because they are hard to understand.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement