I'm having a difficult time understanding how return and scopes work.
I have this code and what I need is be able to use the "obj" variable and its content in the global scope, or a separate function from the one where it is declared.
input.addEventListener('change', function(e){
const reader = new FileReader()
reader.onload = function(){
var obj = JSON.parse(reader.result);
}
reader.readAsText(input.files[0]);
}), false;