fix(curriculum): update slice method example in JavaScript Strings Review (#59370)

This commit is contained in:
Suchith 2025-03-21 21:06:50 +05:30 committed by GitHub
parent 62c7aea556
commit 840bba314a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,9 +81,9 @@ console.log(text.includes("cat")); // false
```js
const text = "freeCodeCamp";
console.log(text.slice(0,3)); // "free"
console.log(text.slice(4,8)); // "Code"
console.log(text.slice(9,13)); // "Camp"
console.log(text.slice(0, 4)); // "free"
console.log(text.slice(4, 8)); // "Code"
console.log(text.slice(8, 12)); // "Camp"
```
- **The `toUpperCase()` Method**: This method converts all the characters to uppercase letters and returns a new string with all uppercase characters.