<html lang="en">
  <head>
    <meta charset="utf-8"/>
    <title>Functions: Task 4</title>
 
    <link rel="stylesheet" href="../styles.css" />
  </head>

  <body>

    <section class="preview">



    </section>

  </body>


</html>
p {
  color: purple;
  margin: 0.5em 0;
}

* {
  box-sizing: border-box;
}
const names = ['Chris', 'Li Kang', 'Anne', 'Francesca', 'Mustafa', 'Tina', 'Bert', 'Jada'];
const para = document.createElement('p');

const shortNames = names.filter( (name) => name.length < 5);
para.textContent = shortNames;

// Don't edit the code below here!

const section = document.querySelector('section');

section.appendChild(para);
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.