public/subjects/give-me-the-code/README.md

353 B

Give me the code

Instructions

Create a jsFileOnly function that takes an array of filenames (strings) and only keeps those that are ending with .js

Example:

const result = jsFileOnly([
  'essay.docx',
  'index.html',
  'info.txt',
  'lib.js',
  'README.md',
  'script.js',
])

console.log(result) // ['lib.js', 'script.js']