Declaring variables with 'let' and 'var' inside a block

Question | Dec 26, 2017 | hkumar 

Following code declares variables with keywords var and let:

function foo() {

  var x = 1;
  if( x ) {
    let x = 2;
    var y = 3;

    console.log(x + y);
  }

  console.log(x + y);
}

// call foo
foo();

What is the result of calling foo?