A collection of JavaScript problem-solving exercises focused on working with objects, arrays, strings, array methods, input validation, and debugging.
This assignment contains five JavaScript problems designed to practice fundamental and intermediate JavaScript concepts. The solutions focus on validating input, processing arrays and objects, manipulating strings, and using modern array methods to solve practical programming challenges.
- JavaScript (ES6)
A function that generates a student's introduction using information from an object.
Features:
- Validates that the input is a valid object
- Checks for required properties:
name,age, andcourse - Uses
Object.keys()for property validation - Uses template literals to generate the introduction
- Returns
"Invalid"for incorrect or incomplete input
A function that filters active users from an array of user objects.
Features:
- Validates that the input is a non-empty array
- Validates each user object
- Checks for required properties:
nameandisActive - Uses the
filter()method - Returns only users where
isActiveistrue
A function that analyzes a caption and finds hashtag-related information.
Features:
- Validates that the input is a string
- Splits the caption into individual words
- Finds words starting with
# - Counts the total number of hashtags
- Finds the longest hashtag
- Returns the results as an object
A function that adds bonus points to scores and calculates the final total.
Features:
- Validates that the input is a non-empty array
- Checks that all values are numbers
- Uses
map()to add bonus points - Uses
reduce()to calculate the total score
A debugging challenge that generates a leaderboard from student data.
Features:
- Validates the student array
- Checks for required
nameandscoreproperties - Validates that scores are numbers
- Filters students with scores of
70or higher - Converts qualified student names to uppercase
- Returns the first three qualified students
This assignment demonstrates the use of:
- Functions
- Objects
- Arrays
- Input Validation
- Conditional Statements
- Loops
- String Methods
- Template Literals
Object.keys()Array.isArray()filter()map()reduce()slice()- Debugging
- Problem Solving
This project does not use any external dependencies or packages.
Only core JavaScript is required.
git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY-NAME.git