Courses:
Result:
Sample codefunction getData(param){ let array= [] fetch("https://maeyler.github.io/JS/data/Courses.txt").then(r => r.text().then(text=>{ let newArray = text.split("\n"); console.log(newArray); for (let line2 of newArray) { let veri2 = line2.split("\t"); console.log(veri2); let course = new Course(veri2[0], veri2[1], veri2[2], veri2.slice(3)); array.push(course); for (let kurs of array ){ if(kurs.kod==param){ result.innerText = kurs } } } })); }