← All Playwright mock interview topics
Test your knowledge of JavaScript Essentials for Playwright with a timed Playwright MCQ mock test. Each attempt gives you 20 random questions in 20 minutes from a 200-question bank covering variables and scope, data types, type conversion, operators, conditions, loops, functions and closures, strings, arrays, objects, error handling, promises and async/await. Submit to see your score, the correct answers and an explanation for every question.
What this mock test covers
The questions follow Module 2 of the free Playwright with TypeScript tutorial. Revise these lessons if a question catches you out:
- JavaScript variables: var, let and const
- JavaScript data types
- Type conversion in JavaScript
- JavaScript operators
- If, else and switch conditions
- JavaScript loops
- JavaScript functions
- JavaScript string methods
- JavaScript array methods
- JavaScript objects and object methods
- Exception handling with try/catch
- Promises and async/await
Sample questions with answers
- Q. Which keyword declares a block-scoped variable that can be reassigned?
Answer: let
`let` is block-scoped and can be reassigned. `const` is block-scoped but cannot be reassigned, and `var` is function-scoped. - Q. Which keyword should you use by default for values that are never reassigned?
Answer: const
Prefer `const` by default and use `let` only when reassignment is needed. Avoid `var` in modern code. - Q. What is the scope of a variable declared with `var` inside a function?
Answer: Function scope
`var` is function-scoped: it is visible throughout the whole function, ignoring block boundaries like `if` or `for`. - Q. What happens when you access a `let` variable before its declaration?
Answer: It throws a ReferenceError (temporal dead zone)
`let` and `const` are hoisted but not initialised. Accessing them before the declaration line is the temporal dead zone and throws a ReferenceError. - Q. Which statement about `const` objects is TRUE?
Answer: The binding cannot be reassigned, but the object's properties can still be modified
`const` prevents reassigning the variable, not mutating the object. Use `Object.freeze()` for shallow immutability.
Ready for more? Go back to the Playwright mock interview dashboard to track your overall interview readiness across all topics.
Frequently asked questions
How many questions does the JavaScript Essentials for Playwright mock test have?
The question bank has 200 questions. Each test picks 20 at random, favouring questions you have not seen, so about 10 attempts cover the full bank.
What is the pass mark?
You pass a test with 70% or more, which is 14 of 20 questions correct.
Can I retake the test?
Yes. Retake as often as you like. Every retake draws a fresh set of 20 questions and counts toward your 20-exam readiness target.