Here is the problem: there are 2 functions
function first(){
var char = getChar();
//Some code
}
function getChar(){
var e = function(event){
if(event.code != "Enter"){
document.removeEventListener("keydown", e, false);
return event.code;
}
}
document.addEventListener("keydown", e, false);
}
first();
I need to get the result from getChar() and continue execution of first(). How can i do that? Please leave some sample code.