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