Introduction to Computer Science with JavaScript
Before you start: complete Unit P: Computing Foundations Primer. It explains the language-neutral vocabulary and concepts used in every language track, using non-visual examples.
Accessible beginner curriculum using Node.js
This curriculum teaches introductory programming and computer science through JavaScript, using Node.js for program execution and text-based input/output. It is designed for blind and visually impaired learners who use screen readers, braille displays, magnification, keyboard navigation, or combinations of access technologies. It is also suitable for sighted beginners and mixed-vision classrooms.
JavaScript is widely used in browser applications, server-side systems, and developer tools. This course deliberately starts with Node.js and terminal programs so learners can master programming concepts without needing to interpret a visual web page or graphical interface. Browser-based development can be a later extension.
Course outcomes
By the end of this curriculum, learners should be able to:
- Explain introductory computer science concepts and the software-development cycle.
- Install and verify Node.js and use an editor, terminal, and Node.js REPL.
- Write JavaScript programs using variables, primitive values, expressions, and output.
- Explain dynamic typing, coercion, truthy/falsy values,
undefined,null, andNaN. - Accept and validate terminal input using Node.js input mechanisms.
- Use decisions, loops, arrays, objects, strings, and common collection operations.
- Design functions and use parameters, return values, scope, and closures.
- Explain classes and object-oriented programming at an introductory level.
- Work with files, modules, errors, and asynchronous operations introduced by the curriculum.
- Use Maps, Sets, data processing, and automated tests.
- Design, implement, test, and explain text-based projects and a capstone.
- Evaluate prompts, output order, error messages, and interaction for screen-reader usability.
The goal is a strong introductory foundation, not mastery of the entire JavaScript language or ecosystem.
Prerequisites and intended learners
No previous programming experience is required. Learners need a computer on which a supported Node.js release can be installed, a keyboard-accessible editor, and a terminal. Basic keyboard and file-management skills are useful. Screen-reader proficiency can develop alongside programming.
The course is intended primarily for beginning learners, including students using NVDA, JAWS, VoiceOver, Narrator, braille displays, or magnification. The JavaScript teacher’s guide includes strategies for pacing, asynchronous concepts, accessible debugging, and differentiated instruction.
Why JavaScript and Node.js?
JavaScript connects foundational programming concepts to a large software ecosystem. Node.js makes it possible to run JavaScript outside a browser, supporting a text-first course.
- Programs can run in a terminal and provide text output.
- The Node.js REPL supports short experiments with immediate feedback.
- The same language can later be used for accessible web applications and server-side programs.
- Learners can encounter real-world concepts such as asynchronous operations and modules in a controlled sequence.
JavaScript also has behaviors that require explicit teaching. Dynamic typing and coercion can produce surprising results; undefined, null, and NaN are distinct; arrays and objects have different semantics; and asynchronous code introduces ordering and error-handling questions.
Learning sequence
| Unit | Main topics | Evidence of progress |
|---|---|---|
| 0. Environment setup | Node.js, editor and access technology, workspace, terminal, first file, npm project | Verify Node.js and run a project script |
| 1. Foundations | Computer science, Hello World, variables, primitive values, output | Explain and run a short sequential program |
| 2. Numeric computations | Development process, expressions, input/output, conversion, Math object | Build and test an interactive tip calculator |
| 3. Control flow | Boolean logic, chained conditionals, arrays, for loops, strings | Classify the shared scores and process text |
| 4. Data structures | Array operations, sorting, fixed sequences, objects, Map, iteration | Organize the shared inventory and student profile |
| 5. User input and while loops | readline, sentinel loops, flags, break, continue, termination | Build a validated command loop |
| 6. Functions | Definitions, arguments, returns, arrays/objects, rest parameters | Decompose shared calculations into reusable functions |
| 7. Classes and OOP | Classes, instances, fields, methods, inheritance, composition | Model students and inventory items |
| 8. Files and exceptions | Text files, JSON, exceptions, cleanup | Persist and reload structured records |
| 9. Testing and data analysis | Function/class tests, random values, text frequency, CSV | Test deterministic behavior and summarize data |
| 10. Project-based learning | Text adventure and command-line to-do manager | Implement equivalent project requirements |
| 11. Capstone | Accessible personal data manager, CRUD, search, persistence, tests | Demonstrate an independent, documented solution |
Materials and navigation
- Units 0–1: Setup and Foundations
- Units 2–4: Numbers, Input, Control Flow, and Data
- Units 5–8: Strings, Functions, OOP, and Files
- Units 9–11: Modules, Collections, Testing, and Projects
- Teacher’s guide: instructor planning, accessible instruction, assessment, and AI guidance
- Standardization audit: Python-to-JavaScript alignment and validation status
Return to the curriculum overview to compare Python, JavaScript, and Java.
Runtime version and modern JavaScript conventions
Use Node.js 26.13.0 LTS (the current LTS release as of October 30, 2026) for the course. Node.js 24 is also in LTS maintenance, but new installations should use the current 26.x LTS line. Keep examples compatible with the Node.js 26 LTS runtime and use the latest security/maintenance patch in that line. Check the official Node.js release schedule before installing or upgrading.
The course follows modern JavaScript practices:
- Use const by default and let only when reassignment is required; avoid var in new code.
- Use === and !== for comparisons; convert user input explicitly with Number, String, or other deliberate parsing.
- Prefer descriptive names, small functions, template literals, array methods where they improve clarity, and async/await for asynchronous work.
- Use node: specifiers for built-in modules (for example, node:fs and node:readline/promises).
- Declare module format explicitly in package.json. Use type: commonjs for CommonJS examples and type: module for ES module examples; do not mix require/module.exports with import/export in the same module.
- Handle rejected promises and file-system errors explicitly. Do not assume parsed JSON or external input has the expected shape.
- Use the built-in node:test and node:assert/strict modules for dependency-free introductory tests; Jest remains an optional framework when a project specifically needs it.
- Keep dependencies local to a project, review package provenance, and commit a lockfile for reproducible installations.
Recommended environment
Follow Unit 0 for detailed installation and verification. For a new setup, use a currently supported Node.js Long-Term Support (LTS) release unless course materials specify a different compatible version. Check the official Node.js download page rather than relying on an old version number.
Recommended tools include Node.js and npm, Visual Studio Code or Theia IDE, a terminal, and the learner’s preferred access technology. Theia is an alternative with similar keyboard- and screen-reader-oriented workflows; verify language extensions through Open VSX and test the learner’s screen reader. Use project-local npm dependencies and npx/npm scripts; avoid global installs. Explain each third-party dependency and review its provenance and maintenance before adding it.
Typical verification commands:
node --version
npm --version
node
Windows Powershell
node --version
npm --version
node
At the Node.js prompt, enter a short expression and read the returned value. Use .exit or the documented keyboard command to leave the REPL.
Accessibility and instructional design
JavaScript uses braces to delimit blocks and semicolons may be optional in many contexts. Teach one consistent style and explain punctuation explicitly. Screen-reader users benefit from short functions, descriptive identifiers, predictable formatting, and output that is meaningful when read linearly.
The curriculum emphasizes keyboard-first editor, terminal, and REPL workflows; explicit reading of braces, parentheses, brackets, commas, operators, and template literals; terminal-based core activities; clear prompts and errors; and step-by-step debugging of coercion and asynchronous behavior.
Accessibility is not guaranteed merely because an application prints text. Consider output order, repeated announcements, asynchronous messages, and whether a learner can review the result after it appears. Adapt to the student’s actual technology and preferences.
How to study each lesson
- Read the lesson overview and identify the new language features.
- Read each example structurally. Identify blocks, expressions, function calls, and data values.
- Predict output and note assumptions about types or coercion.
- Run the example in Node.js and compare actual and expected results.
- Change one variable or expression and observe behavior.
- Complete the exercises and record questions.
- When a result is unexpected, inspect the value and its type, then trace the relevant control flow.
- For asynchronous examples, identify when an operation begins, what is awaited, and when its result becomes available.
- Explain the program in your own words and save the work in a portfolio.
Use the REPL for short experiments and files for complete programs. Keep experiments small enough that output can be reviewed without losing context.
Assessment and projects
Assessment can include predicting output, explaining type behavior, tracing a loop, writing a function, refactoring a program, identifying a bug, creating tests, and building a text-based application. Evaluate reasoning, correctness, testing, clarity, and the learner’s ability to explain and change their code.
The capstone should include a written problem statement, requirements, input/output design, data representation, implementation milestones, test cases, and a short demonstration or explanation. The learner should be able to discuss known limitations and how to improve the program.
Teaching with AI
AI may be used by students only for personal conceptual explanations and reinforcement. It may not write, autocomplete, repair, complete, or generate course code or assessment solutions. Students must independently produce and explain submitted code. Never enter personal information, student records, credentials, private code, or confidential data into public AI services. The teacher’s guide provides the instructor protocol.
Recommended introductory books
- Haverbeke, Marijn. Eloquent JavaScript: A Modern Introduction to Programming, 4th edition. No Starch Press, 2024. A current, exercise-rich introduction to JavaScript fundamentals, browser programming, and Node.js. The full text is available online. Book site and publisher page.
Suggested use: this is the primary supplementary book for the JavaScript track. Its examples include browser-based work; learners following this course should prioritize the language fundamentals and Node.js-compatible examples before attempting activities that depend on browser interfaces. Pair it with the course lessons for the specific accessible terminal workflow and assessment expectations.
Further learning
Use MDN’s JavaScript Guide for language concepts and the Node.js documentation for runtime APIs. Eloquent JavaScript is a further introductory text. Check version-specific documentation when examples depend on newer features.
The course uses JavaScript to teach transferable problem-solving skills. Learners who can reason about values, control flow, data, functions, errors, and tests are prepared to explore browser programming and other parts of the ecosystem.
GUI, visualization, and workbench accessibility
See the shared GUI, visualization, and workbench accessibility reference for screen-reader support by toolkit, platform-specific activation settings, recommended alternatives, and interfaces that must not be required without an equivalent accessible route.