This repository contains intermediate JavaScript homework focused on:
- Loops and Iteration
- Functions
The exercises are designed to help students practice iteration logic, function structure, and basic algorithms using plain JavaScript.
By completing this assignment, students will be able to:
- Write reusable functions
- Use loops to process data
- Iterate over arrays and strings
- Build simple algorithms step by step
- Improve logical thinking using JavaScript fundamentals
- JavaScript (ES6)
- Run using Node.js
- No array methods (
map,filter,reduce,forEach) - Allowed:
- functions
- loops (
for,while) - variables and operators
- basic conditionals (
if)
📦 js-loops-functions-intermediate
┣ 📜 app.js
┣ 📜 README.md
node app.jsCreate a function that:
- Receives an array
- Returns the number of elements in the array
Create a function that:
- Receives an array
- Prints each element with its index
Create a function that:
- Receives an array of numbers
- Uses a loop to calculate the sum
- Returns the result
Create a function that:
- Receives an array of numbers
- Finds and returns the largest number
Create a function that:
- Receives an array
- Returns a new array in reverse order
- Do not use array methods
Create a function that:
- Receives an array and a value
- Counts how many times the value appears
- Returns the count
Create a function that:
- Receives a string
- Prints each character one by one using a loop
Create a function that:
- Receives a number
n - Prints the following pattern:
For n = 4:
*
**
***
****
❌ No array methods
✅ Loops and functions only
✅ Clean and readable code
✅ Comments are encouraged
- Solve the exercises using
whileinstead offor - Add multiple test cases
- Try to reuse functions where possible
JavaScript homework for intermediate students.