Should I use the "for...in" for array iteration a bad idea?
Differentiate with example.
home / developersection / forums / should i use the "for...in" for array iteration a bad idea?
Should I use the "for...in" for array iteration a bad idea?
Differentiate with example.
Kirti Sharma
03-Nov-2022No, We should use for...in for array iteration. Iteration refers to the repetition of statements.
Gourav Jangra
28-Oct-2022for…in is not intended to iterate over arrays in the usual sense. So in most cases, it is the wrong tool. However, there might be rare situations where it is a good idea to use it for that purpose