Well done for reaching the end of the JavaScript Tutorial! This quiz checks the key ideas from every module: the basics, control flow, functions, arrays and objects, the DOM and events, JSON, asynchronous code and errors.
Choose one answer for each question. If you get one wrong, revisit the lesson linked in the summary below and try again.
Before you start
A quick warm-up. Predict the output of this program before running it:
Example JAVASCRIPT
const scores = [45, 82, 67, 90];
const passed = scores.filter((s) => s >= 50);
const average = passed.reduce((sum, s) => sum + s, 0) / passed.length;
console.log(passed.length);
console.log(Math.round(average));
console.log(average >= 80 ? "Distinction" : "Credit");Result
Try it Yourself »3 80 Credit
Did you get it right? filter kept three scores (82, 67 and 90). Their total is 239, and 239 / 3 is about 79.67. Math.round shows that as 80, but the ternary compares the unrounded average, which is below 80 – so the result is "Credit", not "Distinction".
Note: Small details like this – rounding for display versus comparing the real value – cause many real-world bugs. Always know exactly which value you are testing.
The quiz
How did you do?
| Score | What next |
|---|---|
| 13–15 | Excellent! You are ready to build real projects. Try making a shopping cart or a to-do list app. |
| 9–12 | Good work. Review the lessons for the questions you missed. |
| 0–8 | Go back through the lessons one module at a time – especially Data Types, Booleans & Comparisons and Array Methods. |
Where to go next
- Build a small project that uses the DOM and Events: a tip calculator, a quiz app, or a KES-to-USD converter.
- Learn
fetch()to load real data from an API – it uses the same promises andasync/awaityou met in Async JavaScript. - Keep the JavaScript Reference open while you code.
SKOPE