About foreach array with for loop | SoloLearn: Learn to code for FREE!

+4

About foreach array with for loop

b=["u","f","t","s"]; 1.for(i in b) 2.for(i of b) (equivalent to for(a:b) in c) 3.for(i=0;i<b.length;++i) (or for(i=b.length;i--;)) Which one have the fastest performance? I test it and seem to be highly on for(;;) (And Dont recommend me to use .forEach() )

2 Answers

New Answer

+3

+1

so we do not count do while and other options in it ?