0PricingLogin
Dart Academy · Lesson

Searching and Sorting Lists

Find, contains, indexOf, and sort.

Finding Things

Lists give you quick ways to ask questions about their contents, like whether an item exists or where it sits. Let us explore searching. 🔍

Does It Contain?

The contains method returns true or false, telling you whether a value lives somewhere in the list.

var pets = ['cat', 'dog'];
print(pets.contains('dog')); // true

All lessons in this course

  1. Creating Lists and Indexing
  2. Adding, Removing, and Updating Items
  3. Searching and Sorting Lists
  4. Transforming With map, where, and toList
← Back to Dart Academy