Javascript and React Intro
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.
Learning objectives for the week
Monday
Prepare for the week. No classes or reviews today.
Tuesday (class)
Prepare for the class
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.
In-class exercises
Part I: 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
Part II: 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
Wednesday (CodeLab)
Thursday (class)
Prepare for the class
Orient yourself in this documentation:
- Importing and Exporting Components
- Spread operator in JS
- Destructuring in JS
- Functional Components
- Props
- UseState
- UseEffect
- Fetch (GET) in JS
- Fetching (GET) in React
In-class exercises
- Exercise 1: Import/export + spread, and destructuring
- Exercise 2: Composing Components and Props
- Exercise 3: Fetching from an API in React
Friday Exercise
Check TimeEdit for time schedule, teacher, and location - and keep an eye on your inbox for urgent updates.