Javascript (7) - Objet String

12 Jan 2019 · 15 min
15:04

In this French‑language tutorial, the instructor introduces JavaScript strings as both scalar values and objects, showing two ways to create them: literal assignment (e.g., `let str = "bonjour"`) and via the `String` constructor (`new String("bonjour")`). He then reviews the most frequently used string properties and methods—`length`, `charAt`, `indexOf`, `substring`, `toUpperCase`, and `toLowerCase`—explaining their syntax, zero‑based indexing, and optional parameters (e.g., the second argument of `indexOf` to start the search from a given position). The lesson moves to practical applications: first, a live character‑counter for a `<textarea>` that limits input to a maximum length, updates a display field, and trims excess characters using `substring`. Second, an animated typing effect that prints a string one character at a time, then erases it, using a recursive `setTimeout` loop, a direction flag, and `clearTimeout` to stop the animation. Throughout, the speaker demonstrates the code in the browser console, highlights common pitfalls (negative counters, out‑of‑range indices), and provides corrective logic. The tutorial concludes with a recap of string manipulation fundamentals.

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