-
Remove Duplicates: Write a function that takes an array of numbers and returns a new array with duplicate values removed.
-
Find Max Number: Write a function that finds and returns the largest number in a given array of integers.
-
Array Reversal: Write a function that takes an array and returns a new array with the elements in reverse order.
-
Custom Push: Write a function that adds a new element to the end of an array without using
.push(). -
Count Occurrences: Write a function that takes an array and a value, and returns how many times that value appears in the array.
-
Insert at Index: Write a function that inserts a value at a given index in an array, shifting other elements accordingly.
-
Remove by Value: Write a function that removes the first occurrence of a given value from an array.
-
Swap Elements: Write a function that swaps two elements in an array based on their indices.
-
Flatten Array (1 level): Write a function that takes a 2D array and flattens it into a 1D array (assume only one level of nesting).
-
Rotate Array: Write a function that rotates an array to the right by one position. For example,
[1,2,3,4]becomes[4,1,2,3].