Substring length

Report a typo

With the readFile method, you should read the file in which this method is located. Then print to the console the length of the substring up to the first occurrence of the opening parenthesis of the data variable. Perhaps the split method will help you.

Write a program in JavaScript
const fs = require('fs'); //do not change this line

const dataAsync = fs.readFile('main.js', 'utf-8', (err, data) => {
/* your code */
});
___

Create a free account to access the full topic