QP School

Full Version: JavaScript Array entries() example
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
const fruits =
      [
        "Banana",
        "Orange",
        "Apple",
        "Mango"
      ];

const f = fruits.entries();

for(let x of f)
  {
    document.getElementById("demo").innerHTML += x;
  }