DEV Community

Understanding Javascript Array Series IX - Array Loops & Iteration Part VI

Nedy Udombat on October 09, 2019

In the previous article, I talked about iterating over arrays using the forEach array method. You can check it out below: ...
Collapse
 
nwamugo profile image
UGOJI Duziem

Thank you for sharing this insight on JavaScript array 'some' method.

After your first snippet of code, I noticed that you wrote that 'This loop runs until the test case passes.'
Actually, the loop runs until the test case passes or fails.

Also, do you think more comments on our code may speed up understanding? For example, a comment in the first snippet telling us that we are looping through to check for prime characteristics may help me the reader to quickly get what the code does.

Great effort!

Collapse
 
__naaza profile image
Naza

Educative

Collapse
 
nedyudombat profile image
Nedy Udombat

Thank you @__naaza