var animals = [“Grizzly Bear”, “Sloth”, “Sea Lion”];
for (var i = 0; i < animals.length; i++) {
console.log(animals[i]);
}
hi every one
i have a questions, when for works .
why i<animals.length?
it means the last item would not check .is not it ?
because for example ,it begins at 0,then 1,2,
as i<2,it will stop at 1.this means it will not check the last item .
so i did not understand why .
the correct way is for i is equal to i=animals.length.
therefore it can arrive the last item.
instead of i<animals.length.
haha ,thank you for your reply.
je vous remercie votre gentillness mille fois.
i do these exercises at the second time
when i did them at the first time ,i had many difficulty ,but now ,i can do many exercises very rapidly.
of course ,maybe they are foundamental exercises .
but i thank you for your help.