0

When executing the following snippet getting data undefined. Data is declared above the function definition.Not understanding how it become undefined.

var data =100;

test();

function test() {

console.log('Data ',data)
if(false){
   var data ='ppp';
}
}
Andy G
  • 19,232
  • 5
  • 47
  • 69
Javed IN
  • 302
  • 1
  • 4
  • 12

0 Answers0