How to use foreach loop in JavaScript

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        var arr = ["java", "c", "c#", "python"];

        arr.forEach(function(s) {
            console.log(s);
        });
}
 
 
 
 
/*
run:
 
j
a
v
a
 
*/

 



answered Mar 30, 2021 by avibootz
...