workshopper / learnyounode

Learn You The Node.js For Much Win! An intro to Node.js via a set of self-guided workshops.
Other
7.24k stars 1.84k forks source link

Exercise 4 Correct Answer, still fail? #705

Closed kingram6865 closed 4 years ago

kingram6865 commented 4 years ago

Exercise4-Error

The Code:

const fs = require('fs');
const file = process.argv[2];
const str = fs.readFileSync(file).toString();
const result = str.split('\n');
console.log(result.length-1);

Why the FAIL?

jordanSu commented 4 years ago

The second testing result shows that you used synchronous method, however in Exercise 4 an asynchronous method should be used.

ccarruitero commented 4 years ago

Closing since question was answered. Thanks @jordanSu