Skip to content

Latest commit

 

History

History
202 lines (127 loc) · 4.57 KB

File metadata and controls

202 lines (127 loc) · 4.57 KB

JavaScript Course - Spring 2026

Lesson 15, Thursday, 2026-05-07


this is a new lesson format we are experimenting with this semester, feedback welcome!


Peer Review

One or more people examine the work of someone else. Usually happens in teams before considering the code to be ready.


Why peer review?

  • Helps catch bugs early on
  • Improves code quality, reliability, and maintainability
  • Enhances learning through feedback
  • Promotes team collaboration and communication

How to do it right

  • Review code for clarity, not just bugs
  • Suggest improvements, don’t just criticize
  • Ask questions if unclear about logic

Give your feedback on this code:

let n = 3;
let p = 8;
console.log(n * p);

Variable names could be better


Give your feedback on this code:

let numFriends = 2;
let ticketPrice = 2;
let totalPrice = numFriends ** ticketPrice;
console.log(totalPrice); // output is 4

There is a bug, it should be *, not **


Give your feedback on this code:

function isUserActive(user) {
  if (user.isDeleted === true) {
    return false;
  } else {
    return true;
  }
}

let userActive = isUserActive(user);

It can be simpler: let userActive = !user.isDeleted


Self-Review

before peer review, always look at your code with a critical eye before considering it ready, it saves time for others, and it helps make the code easier to understand.


Ask yourself the following questions:

  • Would my teammates understand this?
  • Would I understand this if I came back to it in 6 months?
  • Does this do what it is supposed to do? Does it actually do what i think it does?

Some good habits:

  • Take a break before reviewing
  • Git diffs / Pull requests
  • Rubber ducking

AI Tools

You can use AI tools to help you do the review, but you need to ask the right questions, and think critically about the output.


Demo with ChatGPT


Now try it with some of your code from previous tasks

  • What did it say? Does it make sense?
  • Do you know if its better? why?
  • Can you change adapt your code accordingly?

Additional Resources:


Final Project!


Organizational info

  • Individual or team of 2-3 people
    • Fill out the info in the spreadsheet!
  • Internal presentation date TBD, you will present your project to the class
  • Some projects at Demo Day (different by location)
    • Nominate yourself

Last semesters


More ideas

  • Data visualization of the flee markets in Berlin
  • Calendar for Remote work
  • Grocery shopping list
  • AI in the browser
  • Personal Portfolio

APIs


AI in the browser

Latest Chrome beta can run small AI models in the browser!

let model = await LanguageModel.create();
let answer = await model.prompt("Why is JavaScript awesome?");
// or detect language
let detector = await LanguageDetector.create();
let result = await detector.detect("Merci common ca va?");

Documentation: https://developer.chrome.com/docs/ai/built-in


Project Strategy

Define a Minimum Viable Product (MVP)

Implement essential functionality, and if there's still time, implement the "nice to have" features.