Question 3 of 10Pro Only

What is the difference between == and === in JavaScript? When should you use each?

Sample answer preview

## Overview JavaScript has two equality operators that behave differently: - **`==` (loose equality)**: Compares values after type coercion - **`===` (strict equality)**: Compares values AND types without coercion ## Examples ```javascript // Loose equality (==) - converts types…

type coercionstrict equalityloose equalitycomparison operators

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 9+ more Full-Stack Developer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime