fix(curriculum): clarify that replace() returns a new string in JS lesson (#61730)
Some checks failed
i18n - Build Validation / Validate i18n Builds (22) (push) Has been cancelled
CI - Node.js / Lint (22) (push) Has been cancelled
CI - Node.js / Build (22) (push) Has been cancelled
CI - Node.js / Test (22) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (22) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 22) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 22) (push) Has been cancelled
i18n - Download Client UI / Client (push) Has been cancelled
CD - Docker - DOCR Cleanup Container Images / Delete Old Images (learn-api, dev) (push) Has been cancelled
CD - Docker - DOCR Cleanup Container Images / Delete Old Images (learn-api, org) (push) Has been cancelled

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
Co-authored-by: Ilenia M <nethleen@gmail.com>
This commit is contained in:
Niloy Saha 2025-08-24 00:19:20 +06:00 committed by GitHub
parent 7c25ffc556
commit 1cca628c54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ In JavaScript, there are many scenarios where you may need to replace a portion
For instance, you might need to update user information in a URL, change the formatting of dates, or correct errors in user-generated content.
The `replace()` method in JavaScript allows you to find a specified value (like a word or character) in a string and replace it with another value.
The `replace()` method in JavaScript allows you to find a specified value (like a word or character) in a string and replace it with another value. The method returns a new string with the replacement and leaves the original unchanged because JavaScript strings are immutable.
Here is the basic syntax:

View File

@ -98,7 +98,7 @@ const text = "HELLO, WORLD!"
console.log(text.toLowerCase()); // "hello, world!"
```
- **The `replace()` Method**: This method is used to find a specified value (like a word or character) in a string and replace it with another value.
- **The `replace()` Method**: This method allows you to find a specified value (like a word or character) in a string and replace it with another value. The method returns a new string with the replacement and leaves the original unchanged because JavaScript strings are immutable.
```js
const text = "I like cats";

View File

@ -300,7 +300,7 @@ const text = "HELLO, WORLD!"
console.log(text.toLowerCase()); // "hello, world!"
```
- **The `replace()` Method**: This method is used to find a specified value (like a word or character) in a string and replace it with another value.
- **The `replace()` Method**: This method allows you to find a specified value (like a word or character) in a string and replace it with another value. The method returns a new string with the replacement and leaves the original unchanged because JavaScript strings are immutable.
```js
const text = "I like cats";