I found a javascript code that has:
for each (var A in B){ // B is an array [] and has been pushed with some elements
// logic to deal with A in for loop
}
And I open this project in VScode, but it shows me there are syntax error in line:
for each (var A in B){
But I tried to run it and print traces, I found it worked well(it successfully loops every element in B). So is this syntax correct? If not, what is the recommended way to loop through an array in this case? Thanks!