Home | Mailing List | Blog | Tutorial Videos

Batman v. Superman

Consider the following superheroMaker function. What gets logged when we pass the following two inputs?

const superheroMaker = a => {
  return a instanceof Function ? a() : a;
};

console.log(superheroMaker(() => 'Batman'));
console.log(superheroMaker('Superman'));

Select one: