Your first mini-project 🎉
You're six modules in. You already know how to store data in variables, do math with operators, write functions, and make decisions with conditionals. So far you've practiced them separately. Today you bring them all together to build something real.
You're going to create a personal profile in numbers: you give it a name and a birth year, and your program computes the age, the days lived, and a tailored message. A little app, built by you.
The key: small pieces
You won't build the card in one shot. You'll split it into small functions, each with one job:
computeAge→ how old you are.daysLived→ how many days you've been around.ageMessage→ a different phrase depending on your age.profileCard→ puts the three together and assembles the final card.
That's how real programs work: many simple pieces that, combined, do something powerful.
🚩 This is the first checkpoint of your app. Today you model one person. Later you'll grow it: from this card you'll move on to managing a whole team with stats. Everything you learn keeps adding up to a real project.
See it working first
Press Run below to see the finished card. You don't need to understand every line yet: in the exercises you'll build it piece by piece. 👇
Examples
The finished card — press Run
function computeAge(birth, current) { return current - birth; }
function daysLived(age) { return age * 365; }
function ageMessage(age) {
if (age < 18) return "Bursting with energy! 🎧";
if (age < 30) return "In your prime 🚀";
return "Seasoned and wise 🦉";
}
function profileCard(name, birth, current) {
const age = computeAge(birth, current);
return `🪪 PROFILE OF ${name}
Age: ${age} years
Days lived: ${daysLived(age)}
${ageMessage(age)}`;
}
console.log(profileCard("Ana", 2000, 2026));