Hello do I have to make a variable to store the number of items of an array when making my for loop? it was introduced in this lesson. i know we could just directly use array.length directly when making the for loop.
Is it something related to best practices or what?
Secondly, why do we loop to i < contacts.length? why not i = contacts.length? is it because the array first position is 0?
Thanks for any response in advance.
var contacts.length = contactsLength; for (var i = 0; i < contactsLength; i++) OR for (var i = 0; i < contacts.length; i++)