Array Methods: length, includes, for-of: Coding lesson for kids
In “Array Methods: length, includes, for-of”, children learn about fruits.length, fruits.includes("apple") and for (let fruit of fruits) { ... }.
fruits.length: Gives the NUMBER of items in the array — not the last index.
fruits.includes("apple"): Checks whether a value is anywhere in the array — gives back true or false.
for (let fruit of fruits) { ... }: A for-of loop goes directly over EACH item — no index or .length needed.
This lesson is part of JavaScript in Coding at Pearls Valley Academy — What makes a webpage actually do something.
Each lesson starts with a short narrated, animated explanation, then hands-on practice. A wrong answer gets a gentle hint, never a penalty, and children earn stars and pearls as they go.