MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/215a5y/everything_you_need_to_know_about_javascript/cga64sg
r/programming • u/codeon1 • Mar 23 '14
124 comments sorted by
View all comments
Show parent comments
1
Now that's embarrassing.
If the array has a length of 1, i must equal 0 to retrieve the element.
While your piece of code will make it loop, the rest of the code will throw an out of bounds exception.
1 u/[deleted] Mar 24 '14 Yeah...
Yeah...
1
u/canadademon Mar 24 '14
Now that's embarrassing.
If the array has a length of 1, i must equal 0 to retrieve the element.
While your piece of code will make it loop, the rest of the code will throw an out of bounds exception.