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
  • 9,310
  • 2
  • 27
  • 46
Alpit Anand
  • 1,213
  • 3
  • 21
  • 37

0 Answers0