Answer the question
In order to leave comments, you need to log in
Why does it return NaN instead of text file content?
Hello, instead of the contents of the article.txt file, it gives NaN
var fs = require('fs');
var myReadShort = fs.createReadStream(__dirname + '/article.txt');
myReadShort.on('data', function(chunk) {
console.log("Новые данные получены:\n", + chunk);
});
Новые данные получены:
NaN
Answer the question
In order to leave comments, you need to log in
You write a log to the console: string, COMMA, +chunk, it turns out that strings and a chunk with a unary plus are displayed, which leads it to a number, and as a result - NaN
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question