Calling another function after value is not working

Mas*_*ask 1 javascript

I have a simple code to call a value from another function and its not working :

function ABC() {
  var ID = XYZ(id);
  Logger.log(ID); //throws error not defined.
}

function XYZ(id) {
  var id = "1234"
  return id;
}

Run Code Online (Sandbox Code Playgroud)

What I wan to do is capture the value of id from function XYZ and Logger.log it into function ABC. But this reflects error.

Sou*_*ria 5

干得好 -

function ABC() {
  var ID = XYZ();
  Logger.log(ID); // No longer throws the error :)
}

function XYZ() {
  var id = "1234"
  return id;
}
Run Code Online (Sandbox Code Playgroud)