I want to call a function and return a value from another function the problem is that the value is empty
async function Print(){
var result = await readFile();
console.log(result);
}
async function readFile() {
const FileName = ['g.png','g2.png'];
const Files = FileName.length;
texts = '';
FileName.forEach( async function(FileName) {
Tesseract.recognize(FileName,'ara',{ logger: m => console.log(m) }).then(({ data: { text } }) => {
texts += text;
console.log(texts);
})});
return texts;
}