Javascript (2) - Variables, opérateurs et structures de contrôle

26 Dec 2018 · 16 min
16:17

In this French-language tutorial, the presenter introduces fundamental JavaScript concepts for beginners. The lesson begins by explaining how to embed JavaScript code in an HTML page, covering both inline scripts placed inside a <script> tag and external scripts linked via the src attribute. The speaker then details comment syntax (single‑line // and block / … /) and the importance of keeping only JavaScript code between the script tags. Next, variable naming rules are outlined, including allowed characters, case sensitivity, reserved words, and the language’s weak (dynamic) typing, illustrated with examples of reassigning a variable to different primitive types (string, number, boolean). The tutorial proceeds to an overview of operators—arithmetic (+, –, , /, %), assignment (=, +=, etc.), comparison, and logical operators—highlighting the dual role of the + operator for addition and string concatenation, and demonstrating increment techniques (a++, a+=1, a = a + 1) using console.log for output. The presenter then walks through control structures: the if‑else conditional (including nested if‑else and the need for braces), the switch‑case statement with break and default clauses, and iterative loops (while, for, do‑while) with examples that show proper initialization, condition checks, incrementing, and the guarantee of at least one execution in a do‑while loop. Throughout, the speaker emphasizes best practices such as script placement (head vs before </body>) and the sensitivity of JavaScript to case. The lesson concludes by encouraging review of these basics, noting their similarity to C‑style syntax.

Chapters

More from Yamossoun

8:56
youtube.com

Compteur synchrone - Logique séquentielle

2w ago
11:58
youtube.com

Compteur asynchrone et diviseur de fréquence - Logique séquentielle

3w ago
11:37
youtube.com

Les registres (parallèle et à décalage) - Logique séquentielle

1mo ago
6:14
youtube.com

Bascule T (Toggle) - Logique séquentielle

1mo ago
12:05
youtube.com

Bascule JK - Logique séquentielle

1mo ago
9:17
youtube.com

Bascule D flip-flop active sur front montant - Logique séquentielle

1mo ago
10:08
youtube.com

Bascule D Latch - Logique séquentielle

1mo ago
8:13
youtube.com

Bascule RS - Logique séquentielle

1mo ago
5:04
youtube.com

Logique séquentielle - Introduction

2mo ago
1:15
youtube.com

Le codeur - Logique combinatoire #codeur #logique #circuit #booleanlogic

2mo ago
1:56
youtube.com

Algorithme de calcule de la racine carrée par dichotomie #dichotomy #squareroot #algorithm

3mo ago
See all content