50 JavaScript Array Practice Questions
March 24, 2026 in Javascript
🟢 Basic Level (1–15)
- Create an array of 5 numbers and print it.
- Create an array of 3 fruits and access the second element.
- Find the length of an array.
- Add a new element at the end using
push().
- Remove the last element using
pop().
- Add an element at the beginning using
unshift().
- Remove the first element using
shift().
- Create an array and print all elements using
for loop.
- Print all elements using
forEach().
- Replace the second element of an array.
- Check if an element exists using
includes().
- Convert array to string using
join().
- Reverse an array using
reverse().
- Sort an array of numbers.
- Find index of a value using
indexOf().
🟡 Intermediate Level (16–30)
- Create an array and double each value using
map().
- Convert all strings to uppercase using
map().
- Filter even numbers using
filter().
- Filter numbers greater than 50.
- Find sum of array using
reduce().
- Find maximum value using
reduce().
- Count total elements using
reduce().
- Remove duplicate values from an array.
- Merge two arrays.
- Find common elements between two arrays.
- Slice first 3 elements using
slice().
- Remove 2 elements from index 1 using
splice().
- Insert values using
splice().
- Flatten a nested array (basic).
- Check if all elements are positive using
every().
🟠 Advanced Level (31–50)
- Check if any number is greater than 100 using
some().
- Create an array of objects (students with marks).
- Filter students who scored above 80.
- Use
map() to extract student names.
- Calculate total marks of students using
reduce().
- Sort students by marks (ascending).
- Sort students by marks (descending).
- Group numbers into even and odd arrays.
- Find second largest number in array.
- Rotate array to the right by 1 position.
- Count frequency of each element.
- Find missing number in sequence (1–10).
- Remove falsy values (
false, 0, "", null, undefined).
- Convert array of strings to numbers.
- Find longest string in array.
- Chunk array into smaller arrays (size 2).
- Shuffle an array randomly.
- Find intersection of multiple arrays.
- Implement your own
map() function.
- Build a mini Todo app using array methods.
🎯 Bonus Challenge
- Build Student Result Dashboard
- Create Shopping Cart System
- Make Notes App using Arrays
- Build Quiz App (Questions stored in array)