<section></section>
// see https://discourse.mozilla.org/t/array-startswith-method/95965 for context
const birds = ["Parrots", "Falcons", "Eagles", "Emus", "Caracaras", "Egrets"];

// Add your code here

let index = birds.indexOf("Eagles");

if (index !== -1) {
  birds.splice(index, 1);
}

function nameFun(name) {
  if (name.startsWith("E")) {
    return name;
  }

  return "no match";
}

const eBirds = birds.map(nameFun);

// Don’t edit the code below here!
const section = document.querySelector("section");
section.innerHTML = "";

const para1 = document.createElement("p");
para1.textContent = eBirds;

section.appendChild(para1);
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.