← TechnologyThe essentials of

includes(): finding text and understanding case sensitivity

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 10:06. This is not editorial approval.

In a few sentences

In brief

includes() checks if text contains another sequence. Capital and small letters matter.

Useful to know

String.includes() returns true or false according to whether a sequence is present in the text. The check distinguishes uppercase and lowercase letters. It is not a search by meaning and does not mean matching only a whole word. [1]

For example, 'Book catalog'.includes('Book') is true, and the same search text for 'BOOK' gives false. If you want case-insensitive matching, you can also normalize the text and query according to the needs of the language.

It is also important what you consider to be an empty request. Searching for an empty string returns true, so the interface must separately decide whether the empty field means "show everything" or "enter search".

For a small list in the browser includes() may be sufficient. For searching with grammatical forms, arrangement by relevance or a lot of data, an additional solution is needed. Don't introduce simple character finding as a full-fledged search engine.

Sources

For further detail and to check the information:

  1. [1] MDN — String.includes ↗