Introduction
In this assignment, you will learn about some common array operations in JavaScript.
Remove Duplicate elements from an array in JavaScript - Problem 1
Write a function that takes an array as input and returns a new array with all duplicate elements removed. Ensure that the order of the elements in the output array remains the same as in the original array.
|
|
Finding Negative Numbers in an Array - Problem 2
Write a function that takes an array of numbers as input and returns an array containing only the negative numbers from the input array.
|
|
Sum of All Numbers in an Array - Problem 3
Write a function that takes an array of numbers as input and returns the sum of all the numbers in the array.
|
|
Sum of Even Numbers in an Array - Problem 4
Write a function that takes an array of numbers as input and returns the sum of all the even numbers in the array.
|
|
Sum of Odd Numbers in an Array - Problem 5
Write a function that takes an array of numbers as input and returns the sum of all the odd numbers in the array.
|
|
Converting Array into Object by Counting the Number of Times an Element Repeats - Problem 6
Develop a function that transforms an array into an object where the keys are the unique elements from the array, and the values are the counts of how many times each element appears in the array.
|
|
Find the Largest Number in an Array - Problem 7
Write a function that takes an array of numbers as input and returns the largest number in the array.
|
|
Find the Smallest Number in an Array - Problem 8
Write a function that takes an array of numbers as input and returns the smallest number in the array.
|
|
Merge Two Arrays and Remove Duplicate Entries - Problem 9
Develop a function that merges two arrays and removes duplicate entries.
|
|
Counting Truthy Values in an Array - Problem 10
Develop a function that counts the number of truthy values in an array.
|
|
Conclusion
These are some of the most popular JavaScript coding challenges. I hope you have fun and learn something new.