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';
}
}