Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*** ARRAY EXERCISES ***/
- //create a variable that contains an empty array called myCohort
- //add your name to the array
- //add the name of two of your cohort mates to the end of the array
- //this should only require calling one method, and should be done on one line
- //add another cohort mate's name to the beginning of your array
- //log out your array and look at its contents. is it what you expected?
- //remove the item at the end of your array, and add it to the beginning of your array
- //log out your array using console.table, and observe its values
- //find the middle index of your array, and add three new names at that index
- //log out your array again and check its value
- //at the beginning of your array, add a nested array with the names of three instructors in it
- //console log out the value at index 2 in the nested array
- /****** EXTRA HARD CHALLENGE MODE ******/
- //create a function that makes and returns back an object that acts like an array.
- //it should have incremented key names, a length property, and a push method
- //EXTRA EXTRA CHALLENGE:
- //give it an unshift method, and make the values at each index move forward to account for the new entry at the "0" index
- /****** END EXTRA HARD CHALLENGE MODE ******/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement