Page 5: Javascript
Spring 2026 Sample Solution
Right from the start, in this class we will be doing non-trivial JavaScript programming. If you feel like you need to accelerate your learning, see the Javascript in CS559, specifically the “Advice on Learning JavaScript” section.
JavaScript can be tricky to learn because not only must you learn a new language, but usually the programming happens in the context of a web page in a web browser.
The Javascript in CS559 has all sorts of resources about JavaScript, including the rationale for why we are using it in class. If you are already a JavaScript expert, that page will tell you some rules for how we use JavaScript in class. If you are just learning JavaScript, the page has links to some good tutorials. You will also be able to figure a lot out from the examples we provide in the workbooks.
In the 2023 lectures, Lecture 2 discussed some basic JavaScript. These parts are all still relevant (they are consecutive, if you start watching one, it will continue on to the next):
Part of 2023 Lecture 2 | Slides
Part of 2023 Lecture 2 | Slides
Part of 2023 Lecture 2 | Slides
Part of 2023 Lecture 2 | Slides
Javascript can be used in a “functional programming” style. This can be very convenient for writing interactive programs (like we build in class). Many of the demonstrations make use of functional concepts like closures.
If you’d like an introduction to functional programming concepts in JavaScript (or would like a review), you can check out the “help lecture” from the older version of class:
There is also a “functional programming workbook” that provides a similar introduction, in a form similar to the other class workbooks. We just don’t collect it. Functional Programming Tutorial (repo)
On the next page, we will discuss how to put HTML and JavaScript together to do web programming, so we can use it for class.
Next: Page 6 - HTML and JavaScript