Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- One-dimensional Arrays
- Given the following array:
- const arr = [2, 1, 3, 4, 6, 0, 0, 5, 7, 8, 10];
- Try to:
- Reverse the array.
- Create a new copy of the array using the built-in array methods.
- Return true or false whether 10 is in the array.
- Return the first number that is greater than 6.
- Remove any duplicate numbers from the array.
- Flatten the array using a built-in array method. For example:
- // Transform this multidimensional array
- const arr = [1, 2, [3, 4, [5, 6]]];
- // into this one-dimensional array [1, 2, 3, 4, 5, 6];
- Return the most frequently occurring number in the array. Use the following to test your solution:
- const arr = [1, 2, 1, 4, 2, 4, 2, 3, 3, 5, 6, 7, 3, 2];
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement