📜  javascript 将文件行读入数组 vanilla - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:39.831000             🧑  作者: Mango

代码示例2
const fileList = event.target.files;
let fileContent = "";

const fr = new FileReader();
fr.onload = () => {
  fileContent = fr.result;
  console.log('Commands', fileContent);
}

fr.readAsText(fileList[0]);