Answers for "for loop of array javascript"

48

js loop array

var colors = ["red","blue","green"];
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
Posted by: Guest on July-22-2019
0

javascript loop array

var data = {
  name: "root",
  contents: [
    {
      name: "A",
      contents: [
        {
          name: "fileA1",
          contents: ["Hello!"]
        }
      ]
    },
    {
      name: "B",
      contents: [
        {
          name: "dirB1",
          contents: [
            {
              name: "fileB1.1",
              contents: ["Hello!"]
            }
          ]
        }
      ]
    }
  ]
};
Posted by: Guest on May-11-2021

Code answers related to "for loop of array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language