Chapter 04: Data types
Automation learning lab
Playwright Automation
Self Study Guide
Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.
Data types
Strings hold text, numbers hold numeric values, booleans represent true or false, and undefined often means no value has been assigned. null represents an intentional empty value. Objects group values and arrays represent ordered collections.
How it works
Step-by-step walkthrough
- Create different values
- Inspect their types
- Compare the result
Example
const name = 'QA';
const count = 3;
const passed = true;
console.log(typeof name, typeof count, typeof passed);Use Array.isArray to identify arrays; typeof null is historically object.
✎ Your practice task
Inspect the type of an array and investigate why it is object.
Knowledge check
What type is true?
🌐 Continue learning
60-chapter learning path
Start at chapter 1, or choose any topic. Your progress is tracked separately for each chapter.
JavaScript fundamentals
TypeScript fundamentals
Playwright • setup & locators
Playwright • interactions & assertions
Playwright • framework & debugging
Playwright • real-world automation
Interactive practice lab
Try the controls below and observe the corresponding Playwright locator instructions. This browser demo does not execute Node.js or Playwright Test; copy the code to your local Playwright project to automate it.
Task manager demo
Suggested automation
Actions on the demo update these examples. In your local test use a page that contains the same controls.
Download a standalone lab page, then serve it locally (for example with Python's http.server). Navigate to it in a Playwright test.