Q:

Calling another function after value is not working

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;
}

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.  

A:

Still not sure what you are trying to do with your code.  This code is an "Impure Function" which is not recommended in JavaScript.  How much I understood your code, below are my suggestions:
First
function abc() {
  var id = xyz();
  Logger.log(id);
}

function xyz() {
  // Add whatever logic you want here to return ID value
  var id = "1234"
  return id;
}

Second
function abc() {
  // Pass any value as an argument based on your requirement
  var results = xyz('', '', '');
  Logger.log(results.id);
  Logger.log(results.name);
  Logger.log(results.number);
}

function xyz(id, name, number) {
  // Add whatever logic you want here 
  var newId = id || "1234";
  var newName = name || "Mask";
  var newNumber = number || "1234567890";
  return { id: newId, name: newName, number: newNumber };
}

Based on what suits your requirement, you can take help of these codes.