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 5 of 60~12 min • Beginner
Chapter 05JavaScript

Operators and expressions

Operators calculate or compare values. Arithmetic operators include +, -, *, and /. Use === for strict equality without implicit conversion. Logical operators combine conditions; && requires both truthy operands and OR selects the first truthy operand.

How it works

Step-by-step walkthrough

  1. Calculate a total
  2. Compare with the target
  3. Print the boolean

Example

JavaScript
const price = 50;
const qty = 2;
console.log(price * qty);
console.log(price * qty === 100);
Expected result: 100, then true
💡 Point to remember
Prefer strict equality to avoid surprising coercion.

✎ Your practice task

Try comparing 100 and '100' with ===.

Knowledge check

Which operator checks strict equality?

🌐 Continue learning