Help improve SovranCode?

Google Analytics can measure anonymous usage after you choose Allow. Essential account and progress features work either way.

Back to JavaScript course

JavaScript final assessment

Reason across the full course, then write and run code for three applied briefs. Your work saves automatically on this device or to your signed-in account.

PART 1 · CUMULATIVE REASONING

Connect the ideas across 32 lessons and six projects

Answer all 38 scenario questions. A score of 80% passes this knowledge check. Scores are recomputed from your answers when saved; this is guided learning evidence, not a certificate.

1. A script works in a browser but fails in a plain Node.js process because document is undefined. What is the best explanation?
2. A quantity arrives from a form as the string '3'. Where should it be converted and validated?
3. Which expression preserves a valid zero while falling back for null or undefined?
4. What is the most important invariant for a while loop?
5. Why is a pure total(items) function easier to test than one that fetches, renders, and calculates?
6. You need a new array containing titles of completed lessons. Which pipeline best communicates that intent?
7. Which update is safest when a learner's name should appear as text?
8. A form is enhanced with JavaScript validation. What should the submit handler do before reading FormData?
9. What must happen after reading JSON from localStorage?
10. Two independent requests are both required. Which approach normally avoids unnecessary waiting?
11. A fetch call receives HTTP 404. Which statement is correct?
12. A total is wrong only for an empty array. What is the strongest next step?
13. Which module boundary is easiest to reuse and test?
14. A script throws because document is undefined in a server runtime. What does that prove?
15. Which DOM property displays untrusted input as plain text?
16. What representation avoids routine decimal rounding errors for money?
17. Why test 90 before 50 in an ordered grade chain?
18. Which loop most directly visits each value of an array?
19. What does array.map expect as its first argument?
20. Which check reliably identifies an array?
21. Which method returns the first matching item or undefined?
22. What should a dashboard report for completion of an empty curriculum?
23. What does object spread copy?
24. What determines this for a regular function?
25. When does a destructuring default run?
26. Which collection preserves an object as a key without string conversion?
27. What does successful JSON.parse guarantee?
28. What should identify a book internally?
29. Inside a registered listener, what is currentTarget?
30. Why use closest in a delegated click handler?
31. Why prefer a native button over a clickable div?
32. Where should the task board's source of truth live?
33. When do Promise reactions normally run relative to the next timer task?
34. What does every async function return?
35. Where should an error normally be caught?
36. How can an interface prevent an older request from replacing newer results?
37. Where are normal class instance methods stored?
38. Which module should know about both the DOM adapter and domain functions?

Loading saved work…

PART 2 · APPLIED JAVASCRIPT

Solve three realistic programming briefs

Run the program to observe its behavior, then check the required structures. Automated checks are guidance: you still need to test boundary cases and inspect accessible behavior.

0/3 challenges passed

Normalize and total a shopping cart

Turn uncertain input into a trustworthy cart summary without mutating the supplied array. Run several boundary examples and explain rejected data.

validation · arrays · objects · pure functions

Automatic requirements

  • A summarizeCart(items) function defines the public contract.
  • The input is checked with Array.isArray().
  • Quantity and price use explicit integer validation.
  • An array iteration method computes the result without changing the input.
Normalize and total a shopping cart editorIsolated runner · network disabled
function summarizeCart(items) {
  // Return { itemCount, subtotalCents }.
  // Every item needs a non-empty name, positive integer quantity,
  // and non-negative integer priceCents.
}

console.log(summarizeCart([
  { name: "Course notes", quantity: 2, priceCents: 1250 },
]));
Press Run to execute your code.

Loading saved work…

SovranCode
Learn
Learn on SovranCodeCourses5 free learning paths→ExercisesPractice with live challenges→GuidesDirect answers for developers→E-booksFocused field guides→
Build
Build on SovranCodeProjectsPortfolio-ready builds→TemplatesSovranCode team marketplace→Developer toolsFast browser utilities→
Connect
Connect on SovranCodeForumQuestions and discussions→JournalPractical development notes→AboutWhy SovranCode exists→PricingFree, Plus, and Student Plus→
Services
SearchCreate account
Explore SovranCodeLearn, practice, and build.
LearnCourses5 free learning paths→ExercisesPractice with live challenges→GuidesDirect answers for developers→E-booksFocused field guides→
BuildProjectsPortfolio-ready builds→TemplatesSovranCode team marketplace→Developer toolsFast browser utilities→
ConnectForumQuestions and discussions→JournalPractical development notes→AboutWhy SovranCode exists→PricingFree, Plus, and Student Plus→
Search
THE SOVRANCODE PLATFORM

Learn enough to build something real.

Start learning
100Learning modules
39exercises
6projects
2templates
4E-books
4guides
SovranCode

A free-first programming platform for people who learn best by understanding, practicing, and building.

● Core learning content is free
FollowYouTubePinterestX
LearnHTML courseCSS courseJSJavaScript coursePython courseC courseSQL courseDeveloper guidesAll exercises
BuildProjectsTemplate marketBuyer libraryTemplate licensesDeveloper toolsE-books
CommunityForumJournalContact
CompanyPricing previewAboutServicesPrivacyEnglish edition. Additional languages will be published only after full editorial review.
© 2026 SovranCode · Built for curious minds.Next.js · Node.js · PostgreSQL