Build a Function: Coding lesson for kids
In this lesson, children learn to declare a function, call it with an argument, and read its return value.
function add(a, b) { ... }: Defines a function named add that takes two inputs, called parameters: a and b.
return a + b;: Sends the sum back out to wherever the function was called.
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.