How to read two .txt files and turn these 2 files to a 2d array?
I already have a code like this :
var fs = require('fs')
file = './text1.txt'
fs.readFile(file,'utf-8', (e,d) => {
textByLine = d.split('\r\n');
console.log("test : " + textByLine[1])
})
I succeeded to store the file in a 1d array but now I have 2 files and I want to store them in a 2d array. How to do this?
Thank you