✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
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)