✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
You are given a library with two functions:
-
checkFileName(filename), which returns a Promise. The promise
fulfills to true if the filename uses only valid characters, else it fulfills to false.
-
checkIfExists(filename), which returns a Promise. The promise
fulfills to true if filename exists on the filesystem, else it fulfills false.
Consider
the following versions of the async function processFileName. Which
version(s) correctly checks if a filename uses only valid characters and
then if the file exists? (async functions can use the await keyword in their body)