Correct. However, you should avoid using the for loop in general, because it will iterate over every property of the item passed to it including things which you might not want to iterate over (like a for in loop would do).
Alternatives to for include: forEach, for of, map etc
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
But isn't that essentially what the
forloop is also doing?Correct. However, you should avoid using the
forloop in general, because it will iterate over every property of the item passed to it including things which you might not want to iterate over (like afor inloop would do).Alternatives to
forinclude:forEach,for of,mapetc