On this page
  1. String.includes
  2. Signature & Overview
  3. Notes & Pitfalls
  4. Example

String.includes

Prev: split | Up: String | Next: replaceAll
Rel: String, String, RegExp & Intl Guide
Ref: MDN Web Docs — String.includes
Tags: #public #web #javascript #builtins #string #tier/core


Signature & Overview

str.includes(search)  /* + startsWith(), endsWith() */

Case-sensitive substring presence check returning a boolean.

Notes & Pitfalls

Example

console.assert("JavaScript".includes("Script") === true);
console.assert("JavaScript".includes("script") === false);

Linked from

Related notes