0

Here, I have two functions exactly the same
1)

  function al() {
    return 
    {   
        bar: "hello"
    };
}

console.log(al())

While running this on node this is printing, undefined While the same code, with diff bracket level, return the output
2)

function al() {
    return {   
        bar: "hello"
    };
}

console.log(al())

Please run on node.
Version 10.x

Banzay
  • 8,870
  • 2
  • 22
  • 43
Alpit Anand
  • 976
  • 1
  • 14
  • 30

0 Answers0