Fill: expect Matcher
Fill in the Blank Beginner
Question
Fill in the blank to check strict equality:
Code
test('strict equality', () => {
expect(5).___(5);
});
Hint
The matcher for strict equality (===) is toBe.
Explanation
The correct answer is toBe. toBe uses Object.is for strict equality comparison. It's the right choice for primitive values like numbers, strings, and booleans. For objects and arrays, use toEqual instead.
Related Resources
Related Lessons
- Jest Basics
Getting started with Jest.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.