I'm having a little trouble with radio buttons, what am I not seeing?

function test(){
  var x = "Available inside this function";
  console.log(x); 
}

test(); // this will output: "Available inside this function"
console.log(x); // will output: ReferenceError: x is not defined

It works the same for functions.