I have done a little test for a project of mine. I have made a variable inside a function, then in a different function I am trying to console log one of those functions. However, my problem is that it is saying X (my variable) is undefined.
I have researched this quite a lot and I haven't found any good answers, I have researched scopes and I have tried to make it corresponding to what I found under that, but even then it doesn't work.
function inputs(){
var x = 19;
return x;
}
function output(){
console.log(x);
}
output();
I want it to log x to the console, but it says x is undefined.
Thank you in advance!