function test(t) {
  if (t === undefined) {
     return 'Undefined value!';
  }
  return t;
}

var x;

console.log(test(x));
// expected output: "Undefined value!"