cara menulis dan membaca dari file teks baris demi baris menggunakan javascript

// For react you have fist to import the file you want to read from 

import file from './output.txt';

export function readTextFile(){
    fetch(file)
        .then(response => (response.text()))
        .then(data => {
            // Do something with your data
            console.log(data)
        });
}
Dina TAKLIT