JavaScript fundamentals, one question at a time
If you want to learn JavaScript from the ground up, or you already know another language and want to see where JavaScript behaves differently, this course replaces long reading with short questions on the fundamentals.
Lesson 1 covers how JavaScript gets into a web page: the script element, the src attribute for external files, what async and defer change about when a script runs, the noscript fallback, and a few contrasts with Java, such as const versus final. Lesson 2 is about syntax and scope: what a declared but unassigned variable holds, how automatic semicolon insertion can make a return statement give back undefined, how closures capture outside variables, and what happens when you skip the declaration keyword. Lesson 3 works with the Date object and arrays: what a Date stores internally, why getDay() counts from zero, and what push, shift and join return.
Each lesson starts with a brief explanation, then gives you four or five steps. Some are multiple choice, others ask you to type a keyword or a number, often after reading a short snippet of code. If your answer is wrong, the AI tutor asks a question aimed at the mistake, then gives a hint, then part of the solution. You can tap Show solution whenever you want it. A quick quiz before and after the lesson shows what moved.
The course was built automatically from the first chapters of the open textbook "JavaScript" on Wikibooks, and no person has reviewed it. The book is written by volunteers and may contain errors; these three lessons cover only its opening chapters.
What the lessons cover
- Load scripts in HTML: script tags, deferred execution and noscript
- Declare variables with let and const and predict undefined values, scope and closures
- Spot what automatic semicolon insertion does to a return statement
- Use Date and Array methods such as getDay, push, shift and join
Lessons
JavaScript Basics and HTML Integration
Syntax and Lexical Structure
Working with Dates and Arrays
A step from the arrays lesson

Tutor: Look at this code: const arr = [0, 1, 2, 3]; const len = arr.push(100); What number is stored in len?
You: 100

Tutor: Does push() return the element that was inserted, or does it return the count of elements?
You: The count. The array had 4 elements and now has 5, so len is 5.

Tutor: Right, 5. push adds 100 to the end and returns the new length of the array.
Who will get the most from it
- You are starting to learn JavaScript and want to check your understanding with short questions.
- You know Java or another C-family language and want to see where JavaScript differs.
- You add small scripts to web pages and want to be clear on async, defer and script placement.
- You prefer answering questions to rereading a tutorial.
JavaScript course FAQ
Do I write and run code in the app?
No. You read short code snippets and answer questions about them: pick an option, type a keyword such as shift, or enter the number a line of code returns. If you want to run the code too, your browser's developer console works alongside the course.
Who wrote the lessons?
They were generated automatically from the first chapters of the Wikibooks textbook "JavaScript", which volunteers write under the CC BY-SA 4.0 license. Nobody reviewed the course by hand, so if an answer looks wrong to you, check the original chapter listed in the sources on this page.
Is the course free?
One lesson in Ai Teacher is free. After that, a subscription opens all lessons. You can pay monthly or yearly in Google Play, and usage limits apply.
Source and license
This course is adapted from JavaScript, an open textbook on Wikibooks written by Wikibooks contributors (see the page history of each chapter below). The textbook is licensed under CC BY-SA 4.0.
This course was built automatically from the open textbook "JavaScript" on Wikibooks. No person has reviewed it. Changes: Adapted by AI into lessons and questions; shortened. Written by volunteers; it may contain errors.
Chapters used
Related courses
- Programming
Web Basics: HTML and CSS
How a web page is built: HTML elements, attributes and links, CSS rules and which rule wins, and how wide a box really is. For adults starting from zero.
3 lessons, 18 steps - Programming Open textbook
Non-Programmer's Tutorial for Python 3
Built automatically from three early chapters of the open textbook "Non-Programmer's Tutorial for Python 3" on Wikibooks: input and variables, while loops and decisions. Not reviewed by a person.
From Wikibooks, 3 lessons - Programming Open textbook
Structured Query Language
Built automatically from early chapters of the open textbook "Structured Query Language" on Wikibooks: language elements, creating tables, handling data and an example database. Not reviewed by a person.
From Wikibooks, 3 lessons - Computers Open textbook
Introduction to Computers
Built automatically from early chapters of the open textbook "Introduction to Computers" on Wikiversity: computer types, hardware and software, the processor and future peripherals. Not reviewed by a person.
From Wikiversity, 3 lessons
