Lesson 7 of 34 · Fundamentals
Quiz: JavaScript Fundamentals
Time to check what you've learned in the Fundamentals chapter. Six quick questions cover variables, numbers, strings, comparisons and loops. Read each snippet carefully: the tricky ones are the same gotchas that catch professional developers.
What this quiz covers
The questions check what you learned in the Fundamentals chapter of Learn JavaScript. Not sure about a topic? Review its lesson first:
- Hello, World! Your First JavaScript Program
Write your first JavaScript program: print Hello, World! with console.log and learn how strings, comments and statements work.
- JavaScript Variables: let, const and Data Types
Learn how to declare JavaScript variables with let and const, when to use each, and the basic data types: strings, numbers and booleans.
- JavaScript Numbers and Math Operators
Do math in JavaScript: arithmetic operators, remainder with %, exponents, rounding with the Math object and the classic floating-point gotchas.
- JavaScript Strings and Template Literals
Work with JavaScript strings: template literals, length, indexes, slice, trim, toUpperCase, includes, repeat and other essential string methods.
- JavaScript if/else Statements and Comparison Operators
Make decisions in JavaScript with if, else if and else, compare values with === and !==, combine conditions with && and ||, and spot truthy values.
- JavaScript Loops: for and while
Repeat code with JavaScript for and while loops, use break and continue, loop over the characters of a string and avoid off-by-one errors.
Keep learning
Need a quick reminder? The JavaScript cheat sheet has every topic of Learn JavaScript on one page.
Lesson last updated on .