- Declare an array with 5 elements containing fruits
- console log the 3rd index element
- change the value of the 2nd index element to jambura
- console log the final array
- Declare an array of 3 tourist destinations
- Add a new tourist destination to your tourist array
- Add two more to your array
- Remove the last tourist destination you have added
- display the final array as output
Instructions:
-
Create an array of books containing different book.
-
Use the includes method to check if the array contains a javascript book.
-
Print a message to the console indicating whether the element is present in the array or not.
Instructions:
-
Create different variables, each containing either an array or a non-array value.
-
Now use isArray to check if each variable is an array.
-
Print a message to the console indicating whether each variable is an array or not.
Instructions:
- Create two arrays of your choice.
- Use the concat method to combine the two arrays into a new array.
- Print both the original arrays and the combined array using console.log().