TestingDocs.com logoTestingDocs.com
Automation learning lab
TestingDocs • Self-paced course

Playwright Automation
Self Study Guide

Start from zero. Learn JavaScript and TypeScript, automate browsers, and build reliable end-to-end tests.

60 chaptersBeginner friendlyHands-on practice
JavaScript / Chapter 4 of 60~12 min • Beginner
Chapter 04JavaScript

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

  1. Create different values
  2. Inspect their types
  3. Compare the result

Example

JavaScript
const name = 'QA';
const count = 3;
const passed = true;
console.log(typeof name, typeof count, typeof passed);
Expected result: string number boolean
💡 Point to remember
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