English
Appearance
English
Appearance
10 sessions of 4 academic hours, 40 academic hours in total.
Goal: a deep, solid knowledge of the basics of JavaScript - how the code works, not only what to write - so that you read and write JavaScript with ease and confidence. Applied to your work: by the end of the course you can read and write check rules over JSON documents with confidence, and you can build, test and document a small helper library for the JSON of one product.
Every topic is shown on the kind of data you work with: the JSON report of one device (doc) and a check rule.
The dates may change: the Calendar always shows the current ones.
| Date | Topic | |
|---|---|---|
| 1 | Tue 06.10 | Getting started: course setup, how a program runs, what a variable is |
| 2 | Wed 14.10 | Variables, types and operators |
| 3 | Wed 21.10 | Comparisons, logic, conditions and loops |
| 4 | Fri 23.10 | Arrays and lists of records |
| 5 | Fri 30.10 | Functions, and reading older code |
| 6 | Fri 06.11 | Objects: deep paths, dictionaries, different data shapes |
| 7 | Fri 13.11 | Array methods: transforming, grouping and indexing data; project kickoff |
| 8 | Fri 20.11 | Strings, regular expressions, dates and numbers |
| 9 | Fri 27.11 | JSON, Node.js, modules and errors; running rules locally |
| 10 | Fri 04.12 | Tests, JSDoc types and code quality; Git workflow; project review |
let, const (and why not var); naming rules and conventions.null, undefined; typeof; NaN.++ / --, operator precedence.=== vs ==; why "4.10" < "4.2" is true.&&, ||, !; truthy and falsy; || and ?? as defaults.if / else, switch, the ternary operator; guard clauses (stop early).for, while, do...while, break, continue.|| vs ??.length; push, pop, slice, splice, at.indexOf, includes (the model list in the sample rule); split and join - also for values packed into one string ("a;b", "key=value,key=value").for, for...of; Array.isArray.return.var vs let / const, hoisting; why rule guidelines ask for const globals that are never changed; pure functions.function (x) {...} and as arrows.rule(doc).versionBelow(a, b); a long rule split into small helpers."Firmware Version", "12_4.20").in and Object.hasOwn; optional chaining ?..Object.keys, Object.values, Object.entries, for...in; reading information out of the key."a.b.c": [value]).structuredClone.get(doc, path, fallback) with the path as a string or an array; the details object for emit, with its columns in a fixed order.forEach, map, filter, find / findIndex / findLast, some, every, reduce; flat and flatMap.sort with a compare function, toSorted; numbers, strings, versions, several keys.console.table for records.Object.groupBy, Map); unique values with Set.function (x) { ... } callbacks, forEach with push.library.js with the first helpers.String methods: trim, toLowerCase, startsWith, endsWith, includes, slice, padStart, replaceAll, ...; text encoding: Unicode, UTF-8, line endings.test, match and capture groups, matchAll, replace with the g flag, the i flag; reading the patterns in existing rules.4.2.1.7-B00, 42107-C00, XR420_117): normalise and compare - one shared helper instead of a copy in every rule.Date, time zones, comparing and subtracting dates.Number, parseInt, toFixed, Math (max, min, round, floor, ...)."31_2.07"; the age of a report from different date formats.JSON.parse, JSON.stringify; what JSON cannot hold; reading sample documents with fs.process, package.json, built-in modules, the console object.require / module.exports, as a shared library.js) and ES modules (import / export).try / catch / finally, throw, the error types; why a catch that only returns hides bugs; defensive code for missing or odd data.async / await, and fetch - JSON from a web API.emit() and a folder of sample documents.node:test and assert: helpers, edge cases, whole rules on sample documents.@typedef and // @ts-check (editor checks and autocomplete, no build step).After each session there is a small task on the report JSON. It is reviewed at the start of the next session (about 15 min).
See Course project.