fix: use of otherwise (#57573)

This commit is contained in:
Ilenia 2024-12-17 19:17:15 +01:00 committed by GitHub
parent d4df2d192a
commit cfdc8a121a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -21,19 +21,19 @@ What is the return value for the `includes()` method?
#### --distractors--
If the substring is found within the string, the method returns the string otherwise, it returns `undefined`.
If the substring is found within the string, the method returns the string. Otherwise, it returns `undefined`.
---
If the substring is found within the string, the method returns `true` otherwise, it returns an empty string.
If the substring is found within the string, the method returns `true`. Otherwise, it returns an empty string.
---
If the substring is found within the string, the method returns the string otherwise, it returns `null`.
If the substring is found within the string, the method returns the string. Otherwise, it returns `null`.
#### --answer--
If the substring is found within the string, the method returns `true` otherwise, it returns `false`.
If the substring is found within the string, the method returns `true`. Otherwise, it returns `false`.
### --question--

View File

@ -62,7 +62,7 @@ console.log(char); // A
## Other Common String Methods
- **The `indexOf` Method**: This method is used to search for a substring within a string. If the substring is found, `indexOf` returns the index (or position) of the first occurrence of that substring. If the substring is not found, `indexOf` returns -1, which indicates that the search was unsuccessful.
- **The `includes()` Method**: This method is used to check if a string contains a specific substring. If the substring is found within the string, the method returns true otherwise, it returns false.
- **The `includes()` Method**: This method is used to check if a string contains a specific substring. If the substring is found within the string, the method returns true. Otherwise, it returns false.
- **The `slice()` Method**: This method extracts a portion of a string and returns a new string, without modifying the original string. It takes two parameters: the starting index and the optional ending index.
- **The `toUpperCase()` Method**: This method converts all the characters to uppercase letters and returns a new string with all uppercase characters.
- **The `toLowerCase()` Method**: This method converts all characters in a string to lowercase.

View File

@ -262,7 +262,7 @@ console.log(char); // A
## Other Common String Methods
- **The `indexOf` Method**: This method is used to search for a substring within a string. If the substring is found, `indexOf` returns the index (or position) of the first occurrence of that substring. If the substring is not found, `indexOf` returns -1, which indicates that the search was unsuccessful.
- **The `includes()` Method**: This method is used to check if a string contains a specific substring. If the substring is found within the string, the method returns true otherwise, it returns false.
- **The `includes()` Method**: This method is used to check if a string contains a specific substring. If the substring is found within the string, the method returns true. Otherwise, it returns false.
- **The `slice()` Method**: This method extracts a portion of a string and returns a new string, without modifying the original string. It takes two parameters: the starting index and the optional ending index.
- **The `toUpperCase()` Method**: This method converts all the characters to uppercase letters and returns a new string with all uppercase characters.
- **The `toLowerCase()` Method**: This method converts all characters in a string to lowercase.