Skip to content

TR-04/1531-practice-qs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

JavaScript Array Methods & Utility Functions Practice

1531 prep!

Categories Covered:

  1. Array Utilities (10 functions)

    • difference(), chunk(), intersection(), unique()
    • flatten(), union(), takeWhile(), dropWhile()
    • partition(), zip()
  2. Object Utilities (7 functions)

    • omit(), pick(), merge(), groupBy()
    • invert(), mapValues(), mapKeys()
  3. String Utilities (8 functions)

    • capitalizeWords(), camelCase(), snakeCase(), kebabCase()
    • truncate(), charCount(), isPalindrome(), reverseWords()
  4. Number Utilities (4 functions)

    • range(), clamp(), sum(), average()
  5. Advanced Utilities (6 functions)

    • debounce(), throttle(), memoize()
    • pipe(), compose(), curry()

πŸš€ How to Use

Git clone

Git clone repo

Practice Individual Exercises

Work through the leveled exercises in order:

  1. beginner/ - Start here if new to array methods
  2. intermediate/ - Once comfortable with basics
  3. medium-hard/ - More complex operations
  4. hard/ - Harder
  5. expert/ - Even harder
  6. bonus/ - Harder

πŸ“ Exercise Guidelines

Before You Start:

  • βœ… Read the function description carefully
  • βœ… Look at the examples
  • βœ… Think about which array/string/object methods to use
  • βœ… Consider edge cases

While Working:

  • βœ… Try to use native JavaScript methods (map, filter, reduce, etc.)
  • βœ… Aim for clean, readable code
  • βœ… Consider performance for large inputs
  • βœ… Test with different inputs

If Stuck:

  1. Break the problem into smaller steps
  2. Console.log intermediate values
  3. Look up MDN documentation for array methods
  4. Try a simpler approach first
  5. Check solutions only after genuine attempt

πŸ’‘ Tips for Success

  1. Master reduce() - It's the most powerful array method

    • Can implement map, filter, and most other operations
    • Great for building objects from arrays
  2. Understand Method Chaining

    • Many array methods return new arrays
    • Chain operations: arr.filter().map().reduce()
  3. Know Your Methods

    • Mutating: push, pop, shift, unshift, splice, sort, reverse
    • Non-mutating: map, filter, reduce, slice, concat
  4. Think Functionally

    • Break complex problems into smaller transformations
    • Each method should do one thing well
    • Compose simple operations into complex ones
  5. Practice Regularly

    • Start with 2-3 exercises per day
    • Revisit challenging ones
    • Try implementing solutions in multiple ways

πŸ“š Key Array Methods Reference

Iteration

  • forEach() - Execute function for each element
  • map() - Transform each element
  • filter() - Keep elements that pass test
  • reduce() - Accumulate to single value
  • find() - Find first match
  • some() - Test if any pass
  • every() - Test if all pass

Manipulation

  • push(), pop() - Add/remove from end
  • shift(), unshift() - Add/remove from start
  • splice() - Add/remove at position
  • slice() - Extract portion

Modern ES6+

  • flat() - Flatten nested arrays
  • flatMap() - Map and flatten
  • includes() - Check existence
  • from() - Create from iterable

πŸ”— Helpful Resources

πŸ“ˆ Progress Tracking

Track your progress:

  • Completed all beginner exercises (8)
  • Completed all intermediate exercises (8)
  • Completed all medium-hard exercises (7)
  • Completed all hard exercises (10)
  • Completed all expert exercises (12)
  • Completed bonus challenges
  • Implemented all 40+ utility functions
  • Can explain solutions clearly

About

Practice questions for final (25T3)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published