CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2020-12-25
by cdauth

Original Post

Original - Posted on 2020-12-25
by cdauth



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Here is an example using `fs.stat`, but handling errors correctly as well:
```js async function fileExists(filename) { try { await fs.promises.stat(filename); return true; } catch (err) { if (err.code === 'ENOENT') { return false; } else { throw error; } } } ```
Here is an example using `fs.stat`, but handling errors correctly as well:
```js async function fileExists(filename) { try { await fs.promises.stat(filename); return true; } catch (err) { if (err.code === 'ENOENT') { return false; } else { throw error; } } } ```

        
Present in both answers; Present only in the new answer; Present only in the old answer;