String Includes
Multiple Choice Beginner
Question
What does "hello world".includes("world") return?
Hint
includes checks for substring.
Explanation
"hello world".includes("world") returns true because "world" is a substring. includes() is case-sensitive. For the position, use indexOf() which returns 6. For a case-insensitive check, convert both to lowercase first: str.toLowerCase().includes(search.toLowerCase()).
Related Resources
Related Lessons
- Data Types
Learn JS data types.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.