.splice() method is a powerful tool that allows you to remove or replace elements within an array. By specifying the start index and the number of elements to remove or replace, you can easily modify the contents of your array.
.slice() method allows you to create a new array containing a portion of an existing array. By specifying the start and end indexes, you can extract a subarray from your original array without modifying it.
.indexOf() method allows you to find the index of a specified element within an array. It returns the first occurrence of the element found, or -1 if the element is not present in the array.
.includes() method allows you to quickly check if an array includes a specific element. It returns a boolean value indicating whether the element is found or not.
concat() method to merge two arrays. Create a new array called
moreNumbers by merging
numbers array with the following array
[6, 7, 8].
indexOf() method to find the index of the number 4 in the
numbers array. Assign the result to a variable called
Sign up to start coding
Already have an account?