document.getElementById('button').addEventListener('click', function() {
ApiCall()
console.log(lol)
});
function ApiCall() {
var lol = "this is a test";
}
I have looked into the javascript scopes but how would i pass this variable to the first function ?