01 JS and React I
Learning objectives for the week
Topics covered in this week are:
- JavaScript as a programming language
- JavaScript in a browser
- SPA (Single Page Application)
- React intro

We are going to learn Javascript basics and DOM manipulation on the first day of teaching. Since you all know Java, you will see that Javascript is a bit different. But don’t worry, we will guide you through the differences and similarities.
The browser can be used as the excution environment for Javascript, but you can also also exexute Javascript from the command line using Node.js. We will use both environments in this course.
In the browser, Javascript can be used to manipulate the DOM (Document Object Model) of a webpage. In this way we can create dynamic web pages and do all kind of cool stuff. Everything you probably wanted to do on the 2nd semester. Now it’s time to do it!
So that’s why we start with Javascript and DOM manipulation. Later in the week we will introduce React, a library for building user interfaces. React is a Javascript library, so it’s important to understand Javascript first. And we will learn more and more Javascript as we go along.
Prepare for the week. No classes or reviews today.
As a Java developer, you will benefit from jumping right into the differences between Java and Javascript. So read this article for a crash start:
Also, you need to get familiar with Javascript documentation. Here are some links to get you started. Check it out and try to understand the basics:
Read these parts of the Javascript.info topics:
Below are some great tutorials to watch on the sideline. You don’t need to watch these from start to end, but they are great to have as a reference, and to look up specific language constructs. BUT - at least see the DOM manipulation videos. They are the fundamental building blocks for understanding the rest of the frontend course.
Setting up your development environment
- Install Node.js (LTS version)
- Install Visual Studio Code
- Install Live Server extension in Visual Studio Code
- Install ESLint extension in Visual Studio Code
- Install Prettier extension in Visual Studio Code
- More optional extensions for JavaScript and React development in Visual Studio Code:
| Extension Identifier | Purpose |
|---|---|
| bradlc.vscode-tailwindcss | Tailwind CSS IntelliSense (class name completions for HTML/JSX) |
| dbaeumer.vscode-eslint | ESLint integration for JavaScript and TypeScript linting |
| dsznajder.es7-react-js-snippets | ES7 / React code snippets and shortcuts |
| ecmel.vscode-html-css | HTML and CSS tooling (class name completion, hints) |
| esbenp.prettier-vscode | Prettier code formatter integration (JS/TS/JSON/HTML) |
| formulahendry.auto-close-tag | Automatically close HTML/XML/JSX tags while typing |
| formulahendry.auto-rename-tag | Auto rename matching HTML/XML/JSX tags |
| jonkwheeler.styled-components-snippets | Snippets for styled-components (React CSS-in-JS) |
| kamikillerto.vscode-colorize | Inline color previews for color codes in source files |
| ms-vscode.vscode-typescript-next | Preview features and improvements for TypeScript support |
| pkief.material-icon-theme | Material icon theme for clearer file-type visuals in the editor |
| ritwickdey.liveserver | Live Server to serve and auto-reload static HTML/JS during development |
| vscodevim.vim | Vim emulation (modal editing, keybindings) for the editor |
| wix.vscode-import-cost | Shows bundle-size cost of imported packages inline (JS/TS) |
Main Exercises
- Exercise 1: Getting comfortable with arrays, filter, map, and forEach
- Exercise 2: JS, DOM Manipulation and Events
Part III: Bonus exercises (JS training)
- Exercise 1: Arrow function in JavaScript
- Exercise 2: Destructuring in JavaScript
- Exercise 3: Spread Operator in JavaScript
- Exercise 4: Rest Parameter Syntax in JavaScript
- Starting a new react project with Vite
- Spread operator in JS
- Destructuring in JS
- Functional Components
- Props
- UseState
- UseEffect
- Fetch (GET) in JS
- Fetching (GET) in React
- Exercise 1: Import/export + spread, and destructuring
- Exercise 2: Composing Components and Props
- Exercise 3: Fetching from an API in React
- Start planning your frontend application for your portfolio project. Use a tool like figma or pen and paper to sketch out the UI and the components you will need.
- Based on this article start thinking about how you will break down your UI into components, and which user interactions should be posible in your application. The interactions we will add later.