Skip to content

Latest commit

 

History

History
81 lines (41 loc) · 1.96 KB

13-array-exercise.md

File metadata and controls

81 lines (41 loc) · 1.96 KB

Array Questions

Question 1

Create an array with three elements and print out the second element.

Question 2

Create an array with five elements and print out the length of the array.

Question 3

Create an array with four elements and print out each element using a for loop.

Question 4

Create an array with six elements and print out each element using a forEach loop.

Question 5

Create an array with three elements and add a fourth element to the end of the array.

Question 6

Create an array with four elements and remove the second element.

Question 7

Create an array with five elements and remove the last element.

Question 8

Create an array with three elements and check if the array includes a specific value.

Question 9

Create an array with five elements and sort the array in ascending order.

Question 10

Create an array with five elements and sort the array in descending order.

Question 11

Create two arrays, concatenate them and print out the resulting array.

Question 12

Create an array with three elements and convert it to a string.

Question 13

Create an array with four elements and reverse the order of the elements.

Question 14

Create an array with five elements and find the index of a specific value.

Question 15

Create an array with six elements and slice the array to create a new array with the first three elements.

Question 16

Create an array with six elements and use the map method to double each element.

Question 17

Create an array with four elements and use the while loop to calculate the sum of all elements.

Question 18

Create an array with five elements and use the filter method to return only the even numbers.

Question 19

Create an array with three elements and use the join method to concatenate the elements with a dash (-) separator.

Question 20

Create two arrays with three elements each and use the concat method to combine them into a new array.