I stumbled upon this issue accidentally:
const a = function() {
  return 
  {
    name: "Vijay Kumar"
  }
}
console.log(a());This code above is printing undefined in console. I searched through many similarly titled questions, but those are all talking about different problems.
 
    