The readFile method passed a data argument of a string type to the callback. Inside the callback, we displayed the length of the substring of the data variable until the first occurrence of the semicolon. But parts of the code were lost! You need to restore the specified parts of the program for the code to work correctly!
Introduction to fs module
Semicolon as separator
Report a typo
Write a program in JavaScript
const fs = require('fs'); //do not change this line
const dataAsync = fs.readFile('main.js', /* lost code */, (err, data) => {
console.log(data.split(';')[ ); //part of the code is missing in this line
});
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.