I am using electron version 2.0.5 and ipcMain and ipcRenderer to pass data between my HTML and my main.js
let fna,lna,emaila,passa;
ipcMain.on('fname', function(er, fn){
fna = fn;
console.log(fn)
});
console.log(fna);
When I test it the function runs and when the first console.log runs. I get the right data. But when the second one runs I get undefined... I do not understand electron very well as I am new to it.
Thank you in advance.