Created
February 20, 2020 12:47
-
-
Save rogerwalt/2e899eae7cde0875ffadb4fab0a7f56d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fileNames = ['one.js', 'two.scss', 'three.scss']; | |
const getAllFileNames = () => new Promise((resolve, reject) => { resolve(fileNames) }) | |
const filterScssFiles = (fileNames) => new Promise((resolve, reject) => resolve(fileNames.filter(fileName => fileName.endsWith('.scss')))) | |
getAllFileNames().then(fileNames => filterScssFiles(fileNames)) | |
.then(scssFileNames => console.log(scssFileNames)) | |
.catch(err => console.error(err)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment