JavaScript Scope: Block Scope Before ES6
5 Questions
2 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What happens if you assign a value to a variable that has not been declared in JavaScript?

  • It becomes a global variable (correct)
  • It becomes a function argument
  • It becomes a local variable
  • It will throw an error
  • Which keyword in JavaScript does create a property on the global window object?

  • var (correct)
  • const
  • let
  • function
  • In which mode does all modern browsers support running JavaScript?

  • Strict mode (correct)
  • Global mode
  • Local mode
  • Window mode
  • When does the lifetime of a JavaScript variable start?

    <p>When it is declared</p> Signup and view all the answers

    What happens to global variables in a web browser when you close the browser window?

    <p>They are deleted</p> Signup and view all the answers

    More Like This

    JavaScript Scope
    5 questions

    JavaScript Scope

    InfallibleRationality avatar
    InfallibleRationality
    Scoping and Scope in JavaScript
    43 questions
    Use Quizgecko on...
    Browser
    Browser