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
  • 18,826
  • 5
  • 45
  • 66
Javed IN
  • 247
  • 3
  • 11

0 Answers0