Add a Debug Log
Fill in the Blank Beginner
Question
Fill in the blank to print the value of x for debugging.
Code
let x = 42;
___(x);
Hint
The function that prints to the console in JavaScript.
Explanation
console.log() prints a value to the console, which is useful for debugging. console.log(x) prints 42, letting you verify the variable's value at that point in the code. Other useful methods include console.table() for arrays/objects and console.trace() for the call stack.
Related Resources
Related Lessons
- Debugging Basics
Learn how to debug code systematically.
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.