💥💥Week 3 Day 5 Challenges!
You’ve been doing an incredible job exploring JavaScript—learning about prompt() and for loops today. 💻✨
Now it's time to sharpen those skills with 4 fun and practical challenges!
👀 But don’t worry—you don’t have to do them all! Choose any 2 that you like and give them your best shot. 💪
🧠 THE CHALLENGES:
1. 🔢 Multiplication Table Generator
What to do:
Ask the user for a number using prompt() and print the multiplication table from 1 to 10 for that number.
Hint:
Use a for loop from 1 to 10 and multiply each with the user number.
2. 💥 Custom Symbol Repeater
What to do:
Ask the user to enter a symbol (like #, *, @) and how many times they want to see it repeated. Then print that symbol multiple times.
Hint:
Get both inputs using prompt(), then use a for loop to repeat the symbol.
3. 🔐 Simple Password Guesser
What to do:
Set a secret password in your code. Then ask the user to guess it. Give them only 3 tries. If they guess correctly, show "Access Granted!", otherwise "Blocked!".
Hint:
Use a for loop with a maximum of 3 attempts. Use an if statement inside the loop to check the password.
4. 🔺 Pattern Printer
What to do:
Ask the user for a number. Then print a triangle pattern like this:
Hint:
Use nested loops! One for loop controls the rows, another one builds the pattern using *.
📝 Pick any 2 of these challenges and try your best! If you’re done early, feel free to try the rest too! The more you code, the better you get 🚀
📣 Share your solutions, invite your friends to join our fun coding camp, and as always—
🌞 Stay well and stay coding! ✌️💻
You’ve been doing an incredible job exploring JavaScript—learning about prompt() and for loops today. 💻✨
Now it's time to sharpen those skills with 4 fun and practical challenges!
👀 But don’t worry—you don’t have to do them all! Choose any 2 that you like and give them your best shot. 💪
🧠 THE CHALLENGES:
1. 🔢 Multiplication Table Generator
What to do:
Ask the user for a number using prompt() and print the multiplication table from 1 to 10 for that number.
Hint:
Use a for loop from 1 to 10 and multiply each with the user number.
2. 💥 Custom Symbol Repeater
What to do:
Ask the user to enter a symbol (like #, *, @) and how many times they want to see it repeated. Then print that symbol multiple times.
Hint:
Get both inputs using prompt(), then use a for loop to repeat the symbol.
3. 🔐 Simple Password Guesser
What to do:
Set a secret password in your code. Then ask the user to guess it. Give them only 3 tries. If they guess correctly, show "Access Granted!", otherwise "Blocked!".
Hint:
Use a for loop with a maximum of 3 attempts. Use an if statement inside the loop to check the password.
4. 🔺 Pattern Printer
What to do:
Ask the user for a number. Then print a triangle pattern like this:
*
**
***
****
Hint:
Use nested loops! One for loop controls the rows, another one builds the pattern using *.
📝 Pick any 2 of these challenges and try your best! If you’re done early, feel free to try the rest too! The more you code, the better you get 🚀
📣 Share your solutions, invite your friends to join our fun coding camp, and as always—
🌞 Stay well and stay coding! ✌️💻
Week 3 Day 6 JavaScript Lesson:
👋 Hello Campers!
Welcome to Week 3 Day 6 of our JavaScript Bootcamp! 🎉
You’ve been doing an amazing job so far—learning about variables, conditionals, loops, and how to take user input.
Today, we’re diving into one of the most powerful tools in JavaScript: the Array!
Arrays let you store, organize, and work with collections of data—and once you master them, your code will become faster, smarter, and more efficient. Let’s go! 🚀
🧠 What is an Array?
➤ Definition:
An array is a list-like container that can hold multiple values in a single variable.
Think of it as a shelf where you can store many items:
This is better than creating one variable for each item:
📌 How to Create an Array
➤ Syntax:
Square brackets [] hold the values.
Values are separated by commas.
You can store strings, numbers, booleans, even other arrays or variables.
➤ Examples:
🔍 Accessing Items in an Array
Each item has an index number, starting from 0.
💡 Remember: Index starts at 0, not 1!
✏️ Modifying Array Elements
You can change the value at a specific index like this:
🧩 Array Length
You can check how many items are in an array using .length:
➕ Adding and ➖ Removing Items
➤ .push() – Add to the end
➤ .pop() – Remove from the end
➤ .unshift() – Add to the start
➤ .shift() – Remove from the start
🧪 Example:
🔁 Looping Through Arrays
You can use a loop (like for) to go through each item in the array:
➤ Example:
⚡ Real-World Example: Using prompt with Arrays
You can ask the user for multiple values and store them in an array:
⚠️ Edge Cases to Understand
If you access a non-existing index: undefined
You can store different data types in one array (not recommended for clean code):
👋 Hello Campers!
Welcome to Week 3 Day 6 of our JavaScript Bootcamp! 🎉
You’ve been doing an amazing job so far—learning about variables, conditionals, loops, and how to take user input.
Today, we’re diving into one of the most powerful tools in JavaScript: the Array!
Arrays let you store, organize, and work with collections of data—and once you master them, your code will become faster, smarter, and more efficient. Let’s go! 🚀
🧠 What is an Array?
➤ Definition:
An array is a list-like container that can hold multiple values in a single variable.
Think of it as a shelf where you can store many items:
let shelf = ["book", "pen", "notebook"]; This is better than creating one variable for each item:
let item1 = "book"; let item2 = "pen"; let item3 = "notebook"; 📦 Analogy:
Imagine your backpack. You don’t carry 5 separate bags for your items—you put them all in one backpack.
That’s exactly what an array does for your data!
📌 How to Create an Array
➤ Syntax:
let fruits = ["apple", "banana", "cherry"]; Square brackets [] hold the values.
Values are separated by commas.
You can store strings, numbers, booleans, even other arrays or variables.
➤ Examples:
let numbers = [1, 2, 3, 4, 5];
let mixed = [true, "hello", 42, null];
let empty = []; 🔍 Accessing Items in an Array
Each item has an index number, starting from 0.
let colors = ["red", "green", "blue"];
console.log(colors[0]); // red
console.log(colors[1]); // green
console.log(colors[2]); // blue 💡 Remember: Index starts at 0, not 1!
✏️ Modifying Array Elements
You can change the value at a specific index like this:
colors[1] = "yellow";
console.log(colors); // ["red", "yellow", "blue"] 🧩 Array Length
You can check how many items are in an array using .length:
let animals = ["cat", "dog", "elephant"];
console.log(animals.length); // 3 ➕ Adding and ➖ Removing Items
➤ .push() – Add to the end
animals.push("giraffe"); ➤ .pop() – Remove from the end
animals.pop(); ➤ .unshift() – Add to the start
animals.unshift("lion"); ➤ .shift() – Remove from the start
animals.shift(); 🧪 Example:
let names = ["Ali", "Sara"];
names.push("John"); // ["Ali", "Sara", "John"]
names.unshift("Lina"); // ["Lina", "Ali", "Sara", "John"]
names.pop(); // ["Lina", "Ali", "Sara"]
names.shift(); // ["Ali", "Sara"] 🔁 Looping Through Arrays
You can use a loop (like for) to go through each item in the array:
➤ Example:
let students = ["Abdi", "Mimi", "Fiker"];
for (let i = 0; i < students.length; i++) {
console.log("Student:", students[i]); } ⚡ Real-World Example: Using prompt with Arrays
You can ask the user for multiple values and store them in an array:
let hobbies = [];
for (let i = 0; i < 3; i++) {
let hobby = prompt("Enter a hobby:");
hobbies.push(hobby); }
console.log("Your hobbies:", hobbies);
⚠️ Edge Cases to Understand
If you access a non-existing index: undefined
let items = ["pen"];
console.log(items[3]); // undefined
You can store different data types in one array (not recommended for clean code):
let mix = [42, "text", true, null];Let's see some more methods.
➤.sort() – Sorting items
➤.join() – Turning an array into a string
➤Looping through arrays in a cleaner way
➤Nested arrays – Arrays inside arrays
🔤 1. .sort() – Sorting Array Items
The .sort() method lets you arrange array items in order (alphabetically or numerically).
➤ Alphabetical Sort:
➤ BUT! Be careful with numbers:
💥 WHY? Because .sort() treats them like text, not numbers!
🔗 2. .join() – Turning an Array into a String
Sometimes you want to convert your array into a single string:
You can use any symbol between the items:
🍉 3. Looping the “fruit of fruits” (cleaner loop)
Earlier we used this loop:
But JavaScript gives us a cleaner way called the for...of loop.
➤ Example:
🎉 This is cleaner, easier to read, and perfect for arrays!
📦 4. Nested Arrays – Arrays Inside Arrays
What if each student has multiple scores? We can use a 2D array (like a table):
➤ Accessing nested items:
➤ Looping through nested arrays:
🧠 Summary – Key Things to Remember
✅ Arrays are used to store multiple values.
✅ Indexing starts from 0.
✅ Use .length to know how many items.
✅ Use .push(), .pop(), .shift(), .unshift() to add/remove.
✅ Use loops to go through them.
✅ .sort() arranges items in order
✅ .join() turns an array into a string
✅ for...of is a cleaner way to loop
✅ Nested arrays help you store data in tables
✅ You can loop through nested arrays using nested loops
➤.sort() – Sorting items
➤.join() – Turning an array into a string
➤Looping through arrays in a cleaner way
➤Nested arrays – Arrays inside arrays
🔤 1. .sort() – Sorting Array Items
The .sort() method lets you arrange array items in order (alphabetically or numerically).
➤ Alphabetical Sort:
let fruits = ["banana", "apple", "mango"];
fruits.sort();
console.log(fruits); // ["apple", "banana", "mango"] ➤ BUT! Be careful with numbers:
let numbers = [10, 2, 5, 1];
numbers.sort();
console.log(numbers); // [1, 10, 2, 5] ❌
💥 WHY? Because .sort() treats them like text, not numbers!
🔗 2. .join() – Turning an Array into a String
Sometimes you want to convert your array into a single string:
let colors = ["red", "blue", "green"];
let result = colors.join(", ");
console.log(result); // "red, blue, green"
You can use any symbol between the items:
colors.join(" | "); // "red | blue | green" 🍉 3. Looping the “fruit of fruits” (cleaner loop)
Earlier we used this loop:
for (let i = 0; i < fruits.length; i++) {
console.log(fruits[i]); } But JavaScript gives us a cleaner way called the for...of loop.
➤ Example:
let fruits = ["apple", "banana", "mango"];
for (let fruit of fruits){
console.log("Fruit of fruits:", fruit); }
🎉 This is cleaner, easier to read, and perfect for arrays!
📦 4. Nested Arrays – Arrays Inside Arrays
What if each student has multiple scores? We can use a 2D array (like a table):
let scores = [ [85, 90, 95], [70, 75, 80], / [100, 98, 99] ]; ➤ Accessing nested items:
console.log(scores[0]); // [85, 90, 95]
console.log(scores[0][1]); // 90 ➤ Looping through nested arrays:
for (let i = 0; i < scores.length; i++) {
console.log("Student", i + 1, "scores:");
for (let j = 0; j < scores[i].length; j++) {
console.log(" ➤", scores[i][j]); } } 🧠 Think of it as a table with rows and columns.
🧠 Summary – Key Things to Remember
✅ Arrays are used to store multiple values.
✅ Indexing starts from 0.
✅ Use .length to know how many items.
✅ Use .push(), .pop(), .shift(), .unshift() to add/remove.
✅ Use loops to go through them.
✅ .sort() arranges items in order
✅ .join() turns an array into a string
✅ for...of is a cleaner way to loop
✅ Nested arrays help you store data in tables
✅ You can loop through nested arrays using nested loops
Assignment :
➤array
https://youtu.be/yQ1fz8LY354?si=q1EruBTFpPwa7m0Q
➤2D array
https://youtu.be/SmJNeJuLmVo?si=5GM78WWbLvpVN8P_
➤array
https://youtu.be/yQ1fz8LY354?si=q1EruBTFpPwa7m0Q
➤2D array
https://youtu.be/SmJNeJuLmVo?si=5GM78WWbLvpVN8P_
YouTube
Learn JavaScript ARRAYS in 8 minutes! 🗃
00:00:00 arrays
00:01:06 index
00:02:16 array methods
00:03:07 .length
00:03:41 .indexOf
00:04:33 iterate an array
00:06:34 enhanced for loop
00:07:18 sort
00:07:29 reverse sort
00:07:44 conclusion
// array = a variable like structure that can
// …
00:01:06 index
00:02:16 array methods
00:03:07 .length
00:03:41 .indexOf
00:04:33 iterate an array
00:06:34 enhanced for loop
00:07:18 sort
00:07:29 reverse sort
00:07:44 conclusion
// array = a variable like structure that can
// …
💥💥Week 3 Day 6 Challenges!!
Hey Campers 👋, It’s time to put your array skills to work with today’s exciting challenges!
You’ve learned how to create arrays, loop through them, modify them, and even deal with nested ones. Now, let’s test how much you've understood.
🔍 Choose ANY 3 out of these 5 challenges and try your best to complete them. Take your time — practice is where the magic happens!
🎧 1. Simple Playlist Player
What to do:
Create an array of song names (your favorites!). Ask the user to enter a number, and based on the number, print the song at that position.
Hint:
Use prompt() to ask for a number
Use array[index] to show the song
Add a check so they don’t enter a number outside the array’s range
🧹 2. Clean Up Repeated Items
What to do:
You have an array with some repeated items. Create a new array that contains only unique values (no duplicates).
Hint:
Use a loop and an empty array
Before adding, check with .includes() if it already exists in the new array
You can also try using .indexOf() or Set if you’re curious!
🧠 3. Student Grade Analyzer
What to do:
Create a 2D array where each item contains a student's name and three scores. Loop through each student and calculate their average.
Hint:
Use nested arrays like: ["Sami", 90, 80, 85]
Use a loop to go through each student
Use another loop (or direct addition) to add the 3 numbers and divide by 3
Show: “Sami's average: 85”
📊 4. 2D Array Table Printer
What to do:
Make a 2D array that looks like a table (header + rows), then print each row and each column clearly.
Hint:
Use nested arrays like:
Use nested for loops to print each row and item
✨ 5. Magic Words Reverser
What to do:
Ask the user for a sentence using prompt(). Then reverse the order of words and show the new sentence.
Hint:
Use .split(" ") to turn the sentence into an array
Use .reverse()
Use .join(" ") to turn it back into a sentence
🚀 Choose any 3 challenges, try your best, and share your results in the group!
📣 Don’t forget to invite your coding friends who want to join our journey
🤝 And as always, stay curious, stay coding, and...
✌️ Stay well!
Hey Campers 👋, It’s time to put your array skills to work with today’s exciting challenges!
You’ve learned how to create arrays, loop through them, modify them, and even deal with nested ones. Now, let’s test how much you've understood.
🔍 Choose ANY 3 out of these 5 challenges and try your best to complete them. Take your time — practice is where the magic happens!
🎧 1. Simple Playlist Player
What to do:
Create an array of song names (your favorites!). Ask the user to enter a number, and based on the number, print the song at that position.
Hint:
Use prompt() to ask for a number
Use array[index] to show the song
Add a check so they don’t enter a number outside the array’s range
🧹 2. Clean Up Repeated Items
What to do:
You have an array with some repeated items. Create a new array that contains only unique values (no duplicates).
Hint:
Use a loop and an empty array
Before adding, check with .includes() if it already exists in the new array
You can also try using .indexOf() or Set if you’re curious!
🧠 3. Student Grade Analyzer
What to do:
Create a 2D array where each item contains a student's name and three scores. Loop through each student and calculate their average.
Hint:
Use nested arrays like: ["Sami", 90, 80, 85]
Use a loop to go through each student
Use another loop (or direct addition) to add the 3 numbers and divide by 3
Show: “Sami's average: 85”
📊 4. 2D Array Table Printer
What to do:
Make a 2D array that looks like a table (header + rows), then print each row and each column clearly.
Hint:
Use nested arrays like:
[ ["Name", "Age", "City"], ["Sara", 22, "Adama"], ["Binyam", 20, "Bahir Dar"] ] Use nested for loops to print each row and item
✨ 5. Magic Words Reverser
What to do:
Ask the user for a sentence using prompt(). Then reverse the order of words and show the new sentence.
Hint:
Use .split(" ") to turn the sentence into an array
Use .reverse()
Use .join(" ") to turn it back into a sentence
🚀 Choose any 3 challenges, try your best, and share your results in the group!
📣 Don’t forget to invite your coding friends who want to join our journey
🤝 And as always, stay curious, stay coding, and...
✌️ Stay well!
❤1
🌞 Week 3 Day 7 JavaScript Lesson:
Hey there, awesome campers! 👋
You've made it to Day 7 of Week 3 — and that’s no small thing! You’ve already learned about variables, loops, conditions, arrays... and now it's time to unlock a powerful tool in JavaScript — Functions!
Let’s dive in slowly and clearly, because this one is super important and super useful. Don’t worry — you’re in safe hands 💪. And as always, keep your mind open and your fingers coding!
🧠 What is a Function?
A function is like a reusable machine. You put something in, it does something, and you can get something out.
📦 Simple Analogy: A Coffee Machine
Imagine you have a coffee machine.
You press a button = you call the function.
It takes water + coffee = inputs (parameters).
It gives you a cup of coffee = output (return value).
Once the machine is set up, you can use it again and again. That's what functions are in JavaScript — reusable blocks of code.
🧪 Why Do We Use Functions?
➤➤Avoid repetition — DRY: Don’t Repeat Yourself!
➤➤Organize code better
➤➤Make code reusable
✍️ How to Write a Function (Function Declaration)
Here’s the basic syntax:
Let’s break it down:
function → keyword
sayHello → function name
() → parentheses for input (parameters)
{} → curly braces for function body (the code it runs)
💡 To use (or "call") the function:
🧺 Functions with Parameters
Functions can accept inputs called parameters.
Now you can call it like this:
So here, name is a parameter.
🔙 Functions with Return Values
Sometimes a function gives you something back.
Now you can store or use the result:
The return keyword sends back a value to where the function was called.
🧠 Recap Analogy: Ethiopian Kitchen Example
You give ingredients (parameters) to the chef (function)
The chef cooks (runs the code)
You get injera or shiro (return value)
You can reuse the chef any time with different ingredients!
⚡ Arrow Functions
JavaScript has a shorter way to write functions called arrow functions.
Traditional function:
Arrow function:
If it’s just one line, you can make it even shorter:
⚠️ When to Use Arrow Functions?
➤Great for short/simple functions
➤Useful when passing functions to other functions (you’ll see this later)
➤But arrow functions don’t have their own this keyword (we'll explain in future lessons)
✅ More Examples!
1. Function to square a number:
Arrow version:
2. Greet someone based on time:
3. Function that returns whether a number is even:
Arrow version:
4. Use Functions Inside Loops
Hey there, awesome campers! 👋
You've made it to Day 7 of Week 3 — and that’s no small thing! You’ve already learned about variables, loops, conditions, arrays... and now it's time to unlock a powerful tool in JavaScript — Functions!
Let’s dive in slowly and clearly, because this one is super important and super useful. Don’t worry — you’re in safe hands 💪. And as always, keep your mind open and your fingers coding!
🧠 What is a Function?
A function is like a reusable machine. You put something in, it does something, and you can get something out.
📦 Simple Analogy: A Coffee Machine
Imagine you have a coffee machine.
You press a button = you call the function.
It takes water + coffee = inputs (parameters).
It gives you a cup of coffee = output (return value).
Once the machine is set up, you can use it again and again. That's what functions are in JavaScript — reusable blocks of code.
🧪 Why Do We Use Functions?
➤➤Avoid repetition — DRY: Don’t Repeat Yourself!
➤➤Organize code better
➤➤Make code reusable
✍️ How to Write a Function (Function Declaration)
Here’s the basic syntax:
function sayHello() {
console.log("Hello, world!"); } Let’s break it down:
function → keyword
sayHello → function name
() → parentheses for input (parameters)
{} → curly braces for function body (the code it runs)
💡 To use (or "call") the function:
sayHello(); // It prints: Hello, world! 🧺 Functions with Parameters
Functions can accept inputs called parameters.
function greet(name) {
console.log("Hello, " + name + "!"); } Now you can call it like this:
greet("Abebe"); // Hello, Abebe! greet("Sara"); // Hello, Sara! So here, name is a parameter.
🔙 Functions with Return Values
Sometimes a function gives you something back.
function add(a, b) {
return a + b; } Now you can store or use the result:
let result = add(3, 5); // result is 8
console.log(result); // prints 8 The return keyword sends back a value to where the function was called.
🧠 Recap Analogy: Ethiopian Kitchen Example
You give ingredients (parameters) to the chef (function)
The chef cooks (runs the code)
You get injera or shiro (return value)
You can reuse the chef any time with different ingredients!
function makeJuice(fruit) {
return "Here is your " + fruit + " juice!"; }
console.log(makeJuice("mango"));
console.log(makeJuice("banana"));
⚡ Arrow Functions
JavaScript has a shorter way to write functions called arrow functions.
Traditional function:
function double(x) { return x * 2; } Arrow function:
const double = (x) => { return x * 2; };
If it’s just one line, you can make it even shorter:
const double = x => x * 2;
⚠️ When to Use Arrow Functions?
➤Great for short/simple functions
➤Useful when passing functions to other functions (you’ll see this later)
➤But arrow functions don’t have their own this keyword (we'll explain in future lessons)
✅ More Examples!
1. Function to square a number:
function square(num) {
return num * num; }
console.log(square(4)); // 16 Arrow version:
const square = num => num * num; 2. Greet someone based on time:
function greetByTime(hour) {
if (hour < 12) {
return "Good morning!"; }
else if (hour < 18) {
return "Good afternoon!"; }
else {
return "Good evening!"; } }
console.log(greetByTime(10)); // Good morning! 3. Function that returns whether a number is even:
function isEven(num) {
return num % 2 === 0; }
console.log(isEven(6)); // true
Arrow version:
const isEven = num => num % 2 === 0; 4. Use Functions Inside Loops
function printMultiples(n) {
for (let i = 1; i <= 10; i++) {
console.log(n + " x " + i + " = " + (n*i)); } }
printMultiples(5);Assignment:
➤functions
https://youtu.be/HFaxylC7bUc?si=DhfvE4PNqHvvD8Mk
➤arrow functions
https://youtu.be/fRRRkognpOs?si=XnGBBtvWHCA0odBK
➤functions
https://youtu.be/HFaxylC7bUc?si=DhfvE4PNqHvvD8Mk
➤arrow functions
https://youtu.be/fRRRkognpOs?si=XnGBBtvWHCA0odBK
YouTube
JavaScript FUNCTIONS are easy! 📞
00:00:00 introduction
00:00:14 functions
00:01:57 arguments/parameters
00:04:40 return
00:06:35 example 1
00:07:33 example 2
00:09:30 example 3
00:11:45 conclusion
// function = A section of reusable code.
// Declare code once, use it…
00:00:14 functions
00:01:57 arguments/parameters
00:04:40 return
00:06:35 example 1
00:07:33 example 2
00:09:30 example 3
00:11:45 conclusion
// function = A section of reusable code.
// Declare code once, use it…
💥💥Week 3 day 7 JavaScript challenges:
Today is all about practicing what we’ve learned using functions — and we’re keeping it fun, useful, and a bit magical ✨.
🎯 Choose 3 of the 5 challenges below
Use functions properly (with parameters and return values), and feel free to mix in what you’ve learned about arrays, loops, and even prompt()!
🔧 1. Calculator Function
Task: Build a function that takes two numbers and an operator (+, −, ×, ÷) and returns the answer.
💡 Hint: Use an if or switch inside the function to check which operation to do.
🧼 2. Name Formatter
Task: Create a function that takes a full name (like "abel kidanemariam") and returns it with the first letters capitalized → "Abel Kidanemariam".
💡 Hint: Use .split(" "), .toUpperCase() on first letters, then .join(" ") back.
🔢 3. Number Squarer
Task: Make a function that takes an array of numbers and returns a new array of their squares.
💡 Hint: Loop through the input array, square each item, and .push() to a new one.
😄 4. Emoji Repeater
Task: Build a function that takes an emoji (or any character) and a number, and repeats it that many times.
💡 Hint: Use a for loop or string .repeat() if you know it.
✨ 5. Magic Word Filter
Task: Write a function that takes an array of words and returns only the words longer than 5 letters.
💡 Hint: Loop through the array, use an if to check .length, and store the good ones.
👥 When you're done:
✅Post your work in the group
✅Invite a friend to join our coding journey
✅And as always, stay curious, stay creative — and stay well ✌️
Today is all about practicing what we’ve learned using functions — and we’re keeping it fun, useful, and a bit magical ✨.
🎯 Choose 3 of the 5 challenges below
Use functions properly (with parameters and return values), and feel free to mix in what you’ve learned about arrays, loops, and even prompt()!
🔧 1. Calculator Function
Task: Build a function that takes two numbers and an operator (+, −, ×, ÷) and returns the answer.
💡 Hint: Use an if or switch inside the function to check which operation to do.
calculate(3, '+', 5) ➞ 8 🧼 2. Name Formatter
Task: Create a function that takes a full name (like "abel kidanemariam") and returns it with the first letters capitalized → "Abel Kidanemariam".
💡 Hint: Use .split(" "), .toUpperCase() on first letters, then .join(" ") back.
🔢 3. Number Squarer
Task: Make a function that takes an array of numbers and returns a new array of their squares.
💡 Hint: Loop through the input array, square each item, and .push() to a new one.
squareNumbers([2, 3, 4]) ➞ [4, 9, 16] 😄 4. Emoji Repeater
Task: Build a function that takes an emoji (or any character) and a number, and repeats it that many times.
💡 Hint: Use a for loop or string .repeat() if you know it.
repeatEmoji("🔥", 5) ➞ "🔥🔥🔥🔥🔥" ✨ 5. Magic Word Filter
Task: Write a function that takes an array of words and returns only the words longer than 5 letters.
💡 Hint: Loop through the array, use an if to check .length, and store the good ones.
👥 When you're done:
✅Post your work in the group
✅Invite a friend to join our coding journey
✅And as always, stay curious, stay creative — and stay well ✌️
Week 3 Day 8 JavaScript Lesson:
👋 Hey campers!
Welcome to Week 3 Day 8 of our JavaScript learning journey!
Today, we’ll be wrapping up the last important foundational concepts before we move into Advanced JavaScript starting next week. So buckle up, stay focused, and let's learn something awesome today 🚀
✅ Topics for Today
➤➤Variable Scope (Local vs Global)
➤➤String Methods (Common & Powerful ones)
➤➤The Math Object
➤➤Type Conversion
➤➤Truthy and Falsy Values
➤➤null, undefined, NaN
➤➤Writing Clean Code (Best practices)
🔍 1. Variable Scope (Local vs Global)
Analogy: Imagine variables like people who either stay in their house (local) or walk around the city (global).
🟢 Global Scope
A variable declared outside any function or block is in global scope and can be accessed anywhere in your code.
🔵 Local Scope
A variable declared inside a function or block can only be used there.
Block Scope (let and const only)
👉 Best Practice: Always keep variables local as much as possible to avoid bugs.
🧵 2. String Methods
JavaScript gives us useful tools to work with text (strings).
✍️ Example
🔢 3. The Math Object
JavaScript has a built-in Math object with many useful math tools.
Examples:
👉 You can build games, generate random passwords, or simulate dice rolls with Math.random().
🔄 4. Type Conversion
Changing one type of data to another.
a) To Number
b) To String
c) To Boolean
✅ 5. Truthy and Falsy
In JavaScript, some values act like true, others like false when used in conditions.
🚫 Falsy values:
➤0
➤"" (empty string)
➤null
➤undefined
➤NaN
➤false
Everything else is truthy.
❓ 6. null, undefined, NaN
➤➤undefined
Means a variable has been declared but not given a value.
➤➤null
It means empty or nothing. You assign it.
➤➤NaN (Not a Number)
It means something isn’t a number.
✨ 7. Clean Code Practices
Good habits make code easier to read and debug!
✅ Do:
➥Use clear variable names
➥Keep code organized
➥Use indentation and spacing
➥Comment your logic
➥Avoid repeating yourself (DRY: Don’t Repeat Yourself)
❌ Don’t:
➥Use vague names like x1, temp, data2
➥Mix too many things in one line
➥Leave messy unused code
👋 Hey campers!
Welcome to Week 3 Day 8 of our JavaScript learning journey!
Today, we’ll be wrapping up the last important foundational concepts before we move into Advanced JavaScript starting next week. So buckle up, stay focused, and let's learn something awesome today 🚀
✅ Topics for Today
➤➤Variable Scope (Local vs Global)
➤➤String Methods (Common & Powerful ones)
➤➤The Math Object
➤➤Type Conversion
➤➤Truthy and Falsy Values
➤➤null, undefined, NaN
➤➤Writing Clean Code (Best practices)
🔍 1. Variable Scope (Local vs Global)
Analogy: Imagine variables like people who either stay in their house (local) or walk around the city (global).
🟢 Global Scope
A variable declared outside any function or block is in global scope and can be accessed anywhere in your code.
let name = "Eshetu";
function greet() {
console.log("Hello, " + name); }
greet(); // Hello, Eshetu 🔵 Local Scope
A variable declared inside a function or block can only be used there.
function showAge() {
let age = 25;
console.log(age); }
showAge(); // 25
console.log(age); // ❌ Error: age is not defined Block Scope (let and const only)
if (true) {
let food = "Injera";
console.log(food); // Injera }
console.log(food); // ❌ Error 👉 Best Practice: Always keep variables local as much as possible to avoid bugs.
🧵 2. String Methods
JavaScript gives us useful tools to work with text (strings).
let message = "JavaScript is fun!"; ✍️ Example
let sentence = "Coding is cool";
console.log(sentence.replace("cool", "life")); // Coding is life 🔢 3. The Math Object
JavaScript has a built-in Math object with many useful math tools.
Examples:
console.log(Math.random()); // Random number (0 - 1)
console.log(Math.floor(4.9)); // 4
console.log(Math.ceil(4.1)); // 5
console.log(Math.round(4.5)); // 5
console.log(Math.max(2, 10, 30)); // 30
console.log(Math.min(2, 10, 30)); // 2 👉 You can build games, generate random passwords, or simulate dice rolls with Math.random().
🔄 4. Type Conversion
Changing one type of data to another.
a) To Number
let year = "2025";
let numYear = Number(year); // 2025 b) To String
let score = 100;
let strScore = String(score); // "100" c) To Boolean
Boolean(0); // false
Boolean("Hello"); // true ✅ 5. Truthy and Falsy
In JavaScript, some values act like true, others like false when used in conditions.
🚫 Falsy values:
➤0
➤"" (empty string)
➤null
➤undefined
➤NaN
➤false
Everything else is truthy.
if (0) console.log("No"); // nothing
if (1) console.log("Yes"); // Yes ❓ 6. null, undefined, NaN
➤➤undefined
Means a variable has been declared but not given a value.
let x;
console.log(x); // undefined ➤➤null
It means empty or nothing. You assign it.
let selected = null; ➤➤NaN (Not a Number)
It means something isn’t a number.
let result = "abc" - 2; // NaN ✨ 7. Clean Code Practices
Good habits make code easier to read and debug!
✅ Do:
➥Use clear variable names
➥Keep code organized
➥Use indentation and spacing
➥Comment your logic
➥Avoid repeating yourself (DRY: Don’t Repeat Yourself)
❌ Don’t:
➥Use vague names like x1, temp, data2
➥Mix too many things in one line
➥Leave messy unused code
Assignment :
➤variable scope
https://youtu.be/KyqmbIkZGIo?si=DpOiz2ueQfrFBbJg
➤math.random
https://youtu.be/K2upGO5Bb48?si=1IGyBHU9BUYvsAxv
➤math objects
https://youtu.be/uy-1WNqecnI?si=5s3QFwe5WbHFhyNC
➤variable scope
https://youtu.be/KyqmbIkZGIo?si=DpOiz2ueQfrFBbJg
➤math.random
https://youtu.be/K2upGO5Bb48?si=1IGyBHU9BUYvsAxv
➤math objects
https://youtu.be/uy-1WNqecnI?si=5s3QFwe5WbHFhyNC
YouTube
Learn JavaScript VARIABLE SCOPE in 5 minutes! 🏠
// variable scope = where a variable is recognized
// and accessible (local vs global)
let x = 3; // global scope
function1();
function function1(){
let x = 1; // local scope
console.log(x);
}
function…
// and accessible (local vs global)
let x = 3; // global scope
function1();
function function1(){
let x = 1; // local scope
console.log(x);
}
function…
Week 3 Day 8 JS Challenges
👋 Hey awesome learners!
Now it’s your turn to apply what you’ve learned with today’s exciting challenges!
🎯 Pick any 3 challenges below and start solving!
💸 1. Budget Checker
📌 Ask the user for their monthly budget and then let them enter their weekly expenses (4 times). At the end, tell them if they stayed within their budget or not.
💡 Hints:
Use prompt() in a for loop
Store values in array (optional)
Add them up, compare with budget
📶 2. Mobile Data Tracker
📌 Let the user input how many days they’ve used mobile data and how much they used each day. Calculate total usage and warn them if they’ve passed 1000 MB.
💡 Hints:
Use loop + prompt
Store in array or add directly
Return “⚠️ Limit Exceeded!” if too much
😊 3. Daily Mood Tracker
📌 Ask user for their mood each day of the week (7 times). At the end, summarize how many “happy”, “sad” or “meh” days they had.
💡 Hints:
Loop 7 times
Use if conditions
Count each type
🔐 4. Password Strength Checker
📌 Ask the user to enter a password and give feedback like:
Weak (too short)
Medium (okay length)
Strong (has symbols + capital letters)
💡 Hints:
Use .length, includes(), maybe toUpperCase()
Example symbol check: password.includes("!")
Check if password has capital using .toUpperCase() !== password
❓ 5. Simple Quiz App
📌 Create a 3-question quiz using prompt(). Give score at the end.
💡 Hints:
Store questions in an array (optional)
Track correct answers
Return: “You got X out of 3!”
🫱🏽🫲🏽 Pick 3 you like the most, build them in small steps, and don’t forget:
📢 Share what you built,
📨 Invite your friends to join,
and as always…
Stay creative, stay curious, and stay well! ✌️💻
👋 Hey awesome learners!
Now it’s your turn to apply what you’ve learned with today’s exciting challenges!
🎯 Pick any 3 challenges below and start solving!
💸 1. Budget Checker
📌 Ask the user for their monthly budget and then let them enter their weekly expenses (4 times). At the end, tell them if they stayed within their budget or not.
💡 Hints:
Use prompt() in a for loop
Store values in array (optional)
Add them up, compare with budget
📶 2. Mobile Data Tracker
📌 Let the user input how many days they’ve used mobile data and how much they used each day. Calculate total usage and warn them if they’ve passed 1000 MB.
💡 Hints:
Use loop + prompt
Store in array or add directly
Return “⚠️ Limit Exceeded!” if too much
😊 3. Daily Mood Tracker
📌 Ask user for their mood each day of the week (7 times). At the end, summarize how many “happy”, “sad” or “meh” days they had.
💡 Hints:
Loop 7 times
Use if conditions
Count each type
🔐 4. Password Strength Checker
📌 Ask the user to enter a password and give feedback like:
Weak (too short)
Medium (okay length)
Strong (has symbols + capital letters)
💡 Hints:
Use .length, includes(), maybe toUpperCase()
Example symbol check: password.includes("!")
Check if password has capital using .toUpperCase() !== password
❓ 5. Simple Quiz App
📌 Create a 3-question quiz using prompt(). Give score at the end.
💡 Hints:
Store questions in an array (optional)
Track correct answers
Return: “You got X out of 3!”
🫱🏽🫲🏽 Pick 3 you like the most, build them in small steps, and don’t forget:
📢 Share what you built,
📨 Invite your friends to join,
and as always…
Stay creative, stay curious, and stay well! ✌️💻
Forwarded from Birhan Nega
Don’t Let Questions Make You Feel Small
If you're new to coding and constantly feel like:
“Why can’t I solve this small bug?”
“Is it normal to forget things I just learned?”
“Do real developers know all this by heart?”
“Am I even growing at all?”
Here’s my advice:
👉 Don't mistake confusion for failure.
Even experienced developers:
- Forget syntax
- Google daily
- Ask teammates for help
Get stuck on “simple” problems
The difference?
They’ve learned to be calm in the unknown—not because they know everything, but because they’ve been there enough times.
So if you’re asking a lot of questions, feeling lost at times, or doubting yourself...
✅ That’s not a sign you’re failing.
🔥 That’s a sign you’re learning.
📈 That’s how growth feels before it shows results.
-Stick with it.
-Code messy.
-Break things.
-Google hard.
Ask again.
Finish one more day.
That’s how you build a future-proof career. keep showing up
If you're new to coding and constantly feel like:
“Why can’t I solve this small bug?”
“Is it normal to forget things I just learned?”
“Do real developers know all this by heart?”
“Am I even growing at all?”
Here’s my advice:
👉 Don't mistake confusion for failure.
Even experienced developers:
- Forget syntax
- Google daily
- Ask teammates for help
Get stuck on “simple” problems
The difference?
They’ve learned to be calm in the unknown—not because they know everything, but because they’ve been there enough times.
So if you’re asking a lot of questions, feeling lost at times, or doubting yourself...
✅ That’s not a sign you’re failing.
🔥 That’s a sign you’re learning.
📈 That’s how growth feels before it shows results.
-Stick with it.
-Code messy.
-Break things.
-Google hard.
Ask again.
Finish one more day.
That’s how you build a future-proof career. keep showing up
Extra Challenges: Real-World Flavor
👋 Selam Coder Family!
Week 3 is coming to a close, and wow — you’ve already learned variables, loops, conditions, arrays, functions, and more! That’s not beginner stuff anymore — it’s foundational JavaScript! 💪
But guess what?
Coding is like a muscle 💪 — you build it by using it.
That’s why challenges matter. They connect theory to practice, and give you a taste of real-life problem solving.
So today, let’s dive into 5 practical and slightly spicy challenges. We’re slowly introducing you to the harsh but exciting world of coding. 🔥
✅ Choose 4 challenges to work on today (but feel free to try the remaining one if you can!)
1️⃣ 🕵️ Word Blocker
🧠 What to do:
Ask the user to enter a sentence.
Check if it contains any bad words (e.g. "bad", "ugly", etc).
If yes, replace them with "***".
💡 Hints:
Use .includes() to check if a word is in the sentence.
Use .replace() to block the bad word.
You can use .toLowerCase() to make checking easier.
2️⃣ 🎁 Lucky Draw Picker
🧠 What to do:
Let the user enter names of participants (as an array).
Then randomly pick a winner and print it.
💡 Hints:
Use .push() to collect names using prompt inside a loop.
Use Math.random() and Math.floor() to pick a random index.
3️⃣ 🔄 Name Shuffler
🧠 What to do:
Ask the user to enter their full name.
Reverse the letters of first and last name separately.
Then print it out like a fun secret identity.
💡 Hints:
Use .split(" ") to separate first and last names.
Use .split(""), .reverse(), .join("") for reversing.
4️⃣ 🧠 Memory Word Game
🧠 What to do:
Ask the user to enter 8 words (stored in an array).
Then ask: "What was the 3rd word?"
Check if they remember correctly.
💡 Hints:
Use a loop to collect words into an array.
Use array index to compare the original 3rd word with the answer.
5️⃣ ⏰ Simple Alarm Clock (Simulation)
🧠 What to do:
Ask the user for a wake-up hour (e.g. 7).
Use a loop to count from 1 to that number.
At the final hour, print “⏰ Wake up!”
💡 Extra twist:
Add a for loop and an if to simulate "snoozing" if the user says “not now”. 😉
💡 Hints:
Use for to count hours.
You can add prompt() inside the loop to ask "wake up now?"
🤸 Bonus Tip:
➤➤Try combining the techniques you've learned:
➤➤Use functions to organize your code.
➤➤Use arrays for storing user input.
Use loops, if, prompt, return, etc.
💬 Share your solutions in the group, help your friends, and invite others to join the adventure.
We’re building something amazing together — even if we’re just 53 for now 😄
Stay curious, share the love, invite others, and stay well ✌️
#fullstacksummercamp #Week3 #Challenges #JSBootcamp #PracticeToGrow
👋 Selam Coder Family!
Week 3 is coming to a close, and wow — you’ve already learned variables, loops, conditions, arrays, functions, and more! That’s not beginner stuff anymore — it’s foundational JavaScript! 💪
But guess what?
Coding is like a muscle 💪 — you build it by using it.
That’s why challenges matter. They connect theory to practice, and give you a taste of real-life problem solving.
So today, let’s dive into 5 practical and slightly spicy challenges. We’re slowly introducing you to the harsh but exciting world of coding. 🔥
✅ Choose 4 challenges to work on today (but feel free to try the remaining one if you can!)
1️⃣ 🕵️ Word Blocker
🧠 What to do:
Ask the user to enter a sentence.
Check if it contains any bad words (e.g. "bad", "ugly", etc).
If yes, replace them with "***".
💡 Hints:
Use .includes() to check if a word is in the sentence.
Use .replace() to block the bad word.
You can use .toLowerCase() to make checking easier.
2️⃣ 🎁 Lucky Draw Picker
🧠 What to do:
Let the user enter names of participants (as an array).
Then randomly pick a winner and print it.
💡 Hints:
Use .push() to collect names using prompt inside a loop.
Use Math.random() and Math.floor() to pick a random index.
3️⃣ 🔄 Name Shuffler
🧠 What to do:
Ask the user to enter their full name.
Reverse the letters of first and last name separately.
Then print it out like a fun secret identity.
💡 Hints:
Use .split(" ") to separate first and last names.
Use .split(""), .reverse(), .join("") for reversing.
4️⃣ 🧠 Memory Word Game
🧠 What to do:
Ask the user to enter 8 words (stored in an array).
Then ask: "What was the 3rd word?"
Check if they remember correctly.
💡 Hints:
Use a loop to collect words into an array.
Use array index to compare the original 3rd word with the answer.
5️⃣ ⏰ Simple Alarm Clock (Simulation)
🧠 What to do:
Ask the user for a wake-up hour (e.g. 7).
Use a loop to count from 1 to that number.
At the final hour, print “⏰ Wake up!”
💡 Extra twist:
Add a for loop and an if to simulate "snoozing" if the user says “not now”. 😉
💡 Hints:
Use for to count hours.
You can add prompt() inside the loop to ask "wake up now?"
🤸 Bonus Tip:
➤➤Try combining the techniques you've learned:
➤➤Use functions to organize your code.
➤➤Use arrays for storing user input.
Use loops, if, prompt, return, etc.
💬 Share your solutions in the group, help your friends, and invite others to join the adventure.
We’re building something amazing together — even if we’re just 53 for now 😄
Stay curious, share the love, invite others, and stay well ✌️
#fullstacksummercamp #Week3 #Challenges #JSBootcamp #PracticeToGrow
Week 4 Day 1 Js Lesson:
Hey, campers👋
I hope your fingers are feeling strong from all that typing and your brains are warmed up because today we’re officially stepping into Advanced JavaScript territory.
You’ve already met functions before, like old friends — but today, we’re going to dig deeper, learn their secrets, and make them work harder for us.
We’ll cover:
✅Function Declarations vs. Function ✅Expressions
✅Arrow Functions in Depth
✅Default Parameters
✅Rest & Spread Parameters
1️⃣ Function Declarations vs. Function Expressions
In JavaScript, there’s more than one way to create a function.
Function Declaration
This is the classic way — you just declare it, and JavaScript “hoists” it to the top of its scope, meaning you can call it even before it’s written in your code.
Key points:
➥Hoisted (can be used before they appear in code)
➥Good for situations where order in code doesn’t matter
Function Expression
Here, we store the function inside a variable.
These are NOT hoisted, so you can only use them after they are defined.
If we tried calling sayHi() before its definition — ❌ error.
Why use them?
➥More flexible (can pass them around like normal variables)
➥Useful in callbacks and dynamic code
2️⃣ Arrow Functions — in Depth
We’ve met them before, but let’s explore their deeper behavior.
Differences:
➥Shorter Syntax — Good for quick, one-line functions.
➥this Behavior — Arrow functions don’t have their own this.
Instead, they use the this from the surrounding scope.
Example:
Best use for arrow functions:
➥Small callbacks
➥When you want to keep this from the surrounding scope
3️⃣ Default Parameters
Sometimes, you want your function to have a “backup value” if no argument is given.
Why useful?
➥Avoids undefined when arguments are missing
➥Makes functions safer and easier to use
4️⃣ Rest & Spread Parameters
Rest Parameters (...)
When you don’t know how many arguments will be passed, rest parameters collect them into an array.
Spread Operator (...)
Instead of collecting arguments, spread takes an array and spreads its values into separate arguments.
Uses of spread:
➥Copy arrays:
➥Merge arrays:
💡 Summary of Today’s Power-Ups:
✅Declarations vs. Expressions — know when to use each
✅Arrow functions — short & keep this
✅Default parameters — safer function calls
✅Rest & spread — handle many values with elegance
Hey, campers👋
I hope your fingers are feeling strong from all that typing and your brains are warmed up because today we’re officially stepping into Advanced JavaScript territory.
You’ve already met functions before, like old friends — but today, we’re going to dig deeper, learn their secrets, and make them work harder for us.
We’ll cover:
✅Function Declarations vs. Function ✅Expressions
✅Arrow Functions in Depth
✅Default Parameters
✅Rest & Spread Parameters
1️⃣ Function Declarations vs. Function Expressions
In JavaScript, there’s more than one way to create a function.
Function Declaration
This is the classic way — you just declare it, and JavaScript “hoists” it to the top of its scope, meaning you can call it even before it’s written in your code.
// Function Declaration
function sayHello() {
console.log("Hello, campers!"); }
sayHello(); // ✅ Works even if we call it before the function is defined Key points:
➥Hoisted (can be used before they appear in code)
➥Good for situations where order in code doesn’t matter
Function Expression
Here, we store the function inside a variable.
These are NOT hoisted, so you can only use them after they are defined.
// Function Expression
const sayHi = function() {
console.log("Hi, campers!"); };
sayHi(); // ✅ Works here If we tried calling sayHi() before its definition — ❌ error.
Why use them?
➥More flexible (can pass them around like normal variables)
➥Useful in callbacks and dynamic code
2️⃣ Arrow Functions — in Depth
We’ve met them before, but let’s explore their deeper behavior.
// Normal function
const add = function(a, b) {
return a + b; };
// Arrow function
const addArrow = (a, b) => a + b;
Differences:
➥Shorter Syntax — Good for quick, one-line functions.
➥this Behavior — Arrow functions don’t have their own this.
Instead, they use the this from the surrounding scope.
Example:
const person = { name: "Meresa", normalFunc: function() {
console.log("Normal:", this.name); }, arrowFunc: () => {
console.log("Arrow:", this.name); } };
person.normalFunc();
// Normal: Meresa person.arrowFunc();
// Arrow: undefined (because arrow uses global this) Best use for arrow functions:
➥Small callbacks
➥When you want to keep this from the surrounding scope
3️⃣ Default Parameters
Sometimes, you want your function to have a “backup value” if no argument is given.
function greet(name = "Camper") {
console.log(Hello, ${name}!); }
greet("Abebe"); // Hello, Abebe!
greet(); // Hello, Camper!
Why useful?
➥Avoids undefined when arguments are missing
➥Makes functions safer and easier to use
4️⃣ Rest & Spread Parameters
Rest Parameters (...)
When you don’t know how many arguments will be passed, rest parameters collect them into an array.
function sumAll(...numbers) {
let sum = 0;
for (let num of numbers) {
sum += num; }
console.log(sum); }
sumAll(1, 2, 3); // 6
sumAll(5, 10, 15, 20); // 50
Spread Operator (...)
Instead of collecting arguments, spread takes an array and spreads its values into separate arguments.
const nums = [1, 2, 3];
console.log(Math.max(...nums)); // 3 Uses of spread:
➥Copy arrays:
const arr1 = [1, 2, 3];
const arr2 = [...arr1]; ➥Merge arrays:
const arr3 = [4, 5];
const merged = [...arr1, ...arr3]; // [1,2,3,4,5] 💡 Summary of Today’s Power-Ups:
✅Declarations vs. Expressions — know when to use each
✅Arrow functions — short & keep this
✅Default parameters — safer function calls
✅Rest & spread — handle many values with elegance
❤1
Assignment:
➤spread operator
https://youtu.be/RuDdltsfaVc?si=C52S5F7eQuKYGnRZ
➤rest parameter
https://youtu.be/ahwR1D_GAfc?si=HQGuXPDC0H3KJldP
➤spread operator
https://youtu.be/RuDdltsfaVc?si=C52S5F7eQuKYGnRZ
➤rest parameter
https://youtu.be/ahwR1D_GAfc?si=HQGuXPDC0H3KJldP
YouTube
JavaScript SPREAD OPERATOR in 4 minutes! 📖
// spread operator = ... allows an iterable such as an
// array or string to be expanded
// in to separate elements
// (unpacks the elements)
// -------…
// array or string to be expanded
// in to separate elements
// (unpacks the elements)
// -------…
💥💥Week4 day 1 Challenges:
🚀 Challenge 1: Super Combiner
Write a function that can take any number of arrays (not just two!)
Combine them into one single array
The result should have all the items together
💡 Hints
Use rest parameters to grab all the arrays your function receives.
Then, use spread syntax to unpack them into one big array.
Test with fruit names, numbers, or even names of your classmates.
📝 Challenge 2: Sentence Maker
You have a box of words — maybe they’re proverbs from your grandmother or lyrics from your favorite Ethiopian song. Your job: turn them into a beautiful sentence.
That’s your challenge:
Write a function that takes an array of words
Return a string where the words are joined together with spaces
Bonus: allow extra words to be added separately (use rest parameters)
💡 Hints
First, focus on joining the array words together.
Then, think: “What if I also had extra words I wanted to add?”
🎯 Your mission today:
➥Build both functions with your own creativity.
➥Test them with at least three different examples each.
➥Share your funniest or most creative results in the group.
➥Invite a friend to join our camp and most importantly
🔥 Keep the code flowing, keep the smiles glowing! ✌️
🚀 Challenge 1: Super Combiner
Write a function that can take any number of arrays (not just two!)
Combine them into one single array
The result should have all the items together
💡 Hints
Use rest parameters to grab all the arrays your function receives.
Then, use spread syntax to unpack them into one big array.
Test with fruit names, numbers, or even names of your classmates.
📝 Challenge 2: Sentence Maker
You have a box of words — maybe they’re proverbs from your grandmother or lyrics from your favorite Ethiopian song. Your job: turn them into a beautiful sentence.
That’s your challenge:
Write a function that takes an array of words
Return a string where the words are joined together with spaces
Bonus: allow extra words to be added separately (use rest parameters)
💡 Hints
First, focus on joining the array words together.
Then, think: “What if I also had extra words I wanted to add?”
🎯 Your mission today:
➥Build both functions with your own creativity.
➥Test them with at least three different examples each.
➥Share your funniest or most creative results in the group.
➥Invite a friend to join our camp and most importantly
🔥 Keep the code flowing, keep the smiles glowing! ✌️