Skip to content

Glossary: JavaScript Basics

includes / indexOf

Also written: includes, indexOf

Methods on strings and arrays: `includes(x)` answers `true` or `false`, and `indexOf(x)` gives the position or `-1` if it isn't there.

Where the book teaches it

Related terms

Indexfind / findIndex