You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

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']