// Practice Set · JS Scope · guest

Guest practice: this set is not saved and does not count.

Question 1 of 5 from: JS Scope

What does this log?

function visit() {
  let count = 0;
  count++;
  return count;
}
visit();
visit();
console.log(visit());
Question 2 of 5 from: JS Code Blocks

const go = function () { start(); }; needs a semicolon after the closing brace, but if (ready) { start(); } does not.

Question 3 of 5 from: JS Hoisting

What does this log?

var x = 5;
console.log(x + " " + y);
var y = 7;
Question 4 of 5 from: JS var/let/const

Which statement about declaring the same name twice in one scope is true?

Question 5 of 5 from: JS Strict Mode

What does this log?

function sloppy() {
  a = 1;
  return "sloppy ok";
}
function strict() {
  "use strict";
  try {
    b = 1;
    return "strict ok";
  } catch (e) {
    return "strict " + e.name;
  }
}
console.log(sloppy(), strict());
Ready to submit?

Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.