Advanced JavaScript - fetch, async, modern ES6+
Go beyond the exam: talking to the server, async/await, ES6+
A mini-course for the curious: fetch and AJAX, asynchronous programming (async/await), modern JavaScript (destructuring, modules, spread). The material goes beyond the scope of the INF.03 exam.
Course modules
M1 Talking to the server (fetch) 4 lessons
-
fetch - getting data and Promises
What the fetch API is, how a Promise works, getting data from a server. In the sandbox fetch is mocked for safety.
-
Handling JSON responses and displaying them in the DOM
Parsing JSON with .json(), iterating over an array of data, displaying results in HTML elements.
-
Sending data (POST with fetch) and a mock API
How to send data with the POST method: fetch options, Content-Type headers, a JSON.stringify body. A mock API in the exercises.
-
Error handling (.catch, HTTP statuses)
Handling network errors with .catch(), checking response.ok, HTTP statuses 200/404/500.
M2 Asynchronous programming 4 lessons
-
What asynchrony is: callback → Promise → async/await
The evolution of asynchrony in JS: callback hell, Promises as the solution, async/await as the modern syntax.
-
async/await in practice
Creating async functions, using await, error handling with try/catch, practical examples.
-
setTimeout and setInterval
Delaying code with setTimeout, repeating with setInterval, clearTimeout and clearInterval.
-
Promise.all - parallel operations
Running many Promises at once with Promise.all, handling results and errors in parallel mode.
M3 Modern JavaScript (ES6+) 4 lessons
-
Destructuring arrays and objects
Extracting values from arrays and objects in one statement: syntax, aliases, default values.
-
Spread/rest (...) - expanding and gathering
The ... operator as spread (expanding) and rest (gathering arguments). Merging arrays and objects.
-
Shorthand methods, optional chaining (?.), ??
ES6 shorthand object methods, the ?. operator that protects against null, ?? as a safe default value.
-
What next after JavaScript? Frameworks - a mention
An overview of the JS ecosystem: React, Vue, Angular, Node.js. How to choose a learning path after mastering the basics.