CiTi · Computer Coding · Year Two · Unit 3

Your JavaScript Wiki

Write the JavaScript reference you will still use at the end of the year

The Goal

This year you are learning JavaScript from a long list of short lessons. If you only read them, most of it will be gone in a month. So you are going to write it down: a small website of your own, a wiki, with one page for every lesson. Each page explains one idea in your own words, shows an example, and shows what the example prints.

The wiki is for you. Months from now, when you cannot remember how a loop works, you will open your own page and read the explanation you wrote, in words that make sense to you.

The assignment in one sentence For every JavaScript lesson, learn it, test it, and publish a page on your wiki that covers everything the lesson covers, in your own words, before the Friday due date.

1The Three Places

You will work in three places. Keep all three open.

PlaceWhat it is forWhere
jsdemoThe lessons. Read here, try the examples in Try It, jot notes in My Notes, and take the Section Quiz at the end of each section.citicoding.org/jsdemo
Your wikiWhat you write. One menu page, one page for each lesson.YOURFOLDER/js/
Your status pageHow you are doing. A row of dots, one per lesson, showing which pages are done, missing, or thin.YOURFOLDER/js/status.html
Where your pages live Your wiki has a menu page (js/index.html). You do not type the menu by hand: it searches a central JavaScript lesson database (one shared table of every lesson, with its section, title, and due date) and builds the list for you, grouped by section, in order. When a new lesson is added to the central table, it appears on every student’s menu. Each lesson’s name is a link. Each link goes to one template page, lesson.html, with the lesson number on the end: lesson.html?skuvar=5 shows lesson 5. The number in the link is how your page is found and checked. Your teacher builds the template with you in class.

2A Complete Page

A page is complete when it covers every topic its lesson covers. Open the jsdemo lesson and look at its headings: each heading is a topic. Your page needs each one.

For every topic, write these three things:

  1. What it is. One or two sentences, in your own words. Pretend you are explaining it to a friend who missed class.
  2. An example. A short piece of real code that uses it. Run it in Try It first so you know it works.
  3. What it prints. The output the example gives, copied from what you saw.

Here is the shape of one topic on a page about comments:

Single-line comments A comment is a note for people. JavaScript ignores it. Two slashes start a single-line comment. Example // this line is ignored console.log("Hello"); // this part is ignored too Output Hello
Want a higher score? Go past the lesson. Add a mistake people often make and how to fix it, a second example, or a small table. Depth that helps a reader is rewarded. Padding is not.
Do not copy and paste The check compares your page to the jsdemo lesson. A page that matches it almost word for word is flagged for your teacher, and you learn nothing from it. Close the lesson, say it out loud, then type it. If you cannot explain a topic without looking, that is your cue to read it again.

3Your Week

Lessons come in sections (JS Syntax, JS Operators, and so on), and each section has a Friday due date. A good week looks like this:

  1. Read the lesson in jsdemo. Use My Notes for what clicked and what confused you. (Notes are saved in that browser only.)
  2. Try every example in Try It. Change a value and see what happens.
  3. Write the page on your wiki. One page per lesson, every topic.
  4. Check your live page, then your status page.
  5. Quiz. When the section is finished, take the Section Quiz in jsdemo. It has 15 questions, given 5 at a time in three sets, so you can fix what you missed.
Ask early Stuck on a lesson? Ask before Thursday. A page you finish late still counts, but it is hard to catch up on three sections at once.

4How It Is Checked

Once a week your wiki is checked against the jsdemo lessons. The results appear on your status page. There is one dot per lesson.

ScoreWhat it means
Missing = 0No page, a blank page, or an error. The menu link is missing or does not go to your page
Below 7Half or more of the lesson’s topics are not on your page
7 to 7.5A little over half of the topics are covered
8 to 8.5Most topics are covered (60 to 99%)
9Every topic is covered
9.5 to 10Every topic, plus real extra depth

A section’s score is the average of its lessons. Your overall score is the average of the sections. The score is about completeness. Copied pages show up as a flag your teacher can see; that is a conversation, not a score.

Read your status page like a mistake report A red or empty dot is not a verdict on you. It is data: this page is missing or thin. Fix it, and next week’s dot changes.

5Build It Today

In class, build the first version of your wiki and publish your first lesson page.

  1. In your own student folder (your teacher tells you where it is), make a folder named js. Everything for the wiki goes inside it.
  2. Make the menu page, js/index.html. Give it a title (for example, “Sam’s JavaWiki”). Your teacher shows you how to make the menu search the central lesson database and list every lesson as a link. The first one is JS Syntax (lesson 5).
  3. Make the lesson template your teacher shows you, and put it in js/pages/ as lesson.html.
  4. Open the JS Syntax lesson in jsdemo. List its topics (its headings) in your notes.
  5. Run one example in Try It. Write your first topic: what it is, an example, what it prints.
  6. Upload, then open your live menu and click JS Syntax. Check that the link ends with ?skuvar=5.

Then keep going: finish the other topics on the JS Syntax page, then work down the list in order.

Test the live page Your wiki runs on the server, so always check the live address in Chrome, not a file on your computer. If a page looks wrong, open the browser console to look for errors.

Due Dates

Lessons come in sections, and each section has a Friday due date. The dates are not printed here because they change every year. They live in the same central lesson table that builds your menu, and your teacher will tell you each week what is due.

Where to find them Your menu page lists every section and lesson in order, pulled from the central lesson table. Check the due date shown for the section you are working on, and ask your teacher if you are unsure.

Am I done? Check before you tell your teacher

  • My wiki is in js/ inside my own folder, and my menu page opens on the live site.
  • Every link on my menu ends with the lesson number, like ?skuvar=5.
  • For each lesson, I listed the topics (headings) before I wrote.
  • Every topic on my page has an explanation, an example, and its output.
  • The explanations are in my own words.
  • I ran every example in Try It before I put it on my page.
  • I opened my status page and read what it says about my pages.
  • I know the next Friday due date.