Lesson 1 Homework

%%js
//We have an array made for you, but something's off...
let desserts = ["lemon","delete1","ice cream","chocolate cake","key lime pie","delete2"];
//We need to get rid of the elements labeled delete1 and delete2!
desserts.___();//which command gets rid of the last element in the array?
desserts._____(_,_);//which command will delete the delete 1 element and how do you use it??

//now that that's done... a lemon isn't a dessert unless you're weird... maybe change it to a lemon-themed dessert?
desserts[_]="put your lemon-themed dessert here :D";

//hint for the previous 2 fill-in-the-blanks: the indexing starts at 0

//okay okay, you've proven your skills... now all that's left is to print the list!
<IPython.core.display.Javascript object>

Lesson 2 Homework - Part 1

%%js
//Okay, this will be a little tougher. We can put your knowledge of the second lesson to the test. (ignore that this concept is easy compared to the other lessons lol)

//I want you to create a list of whatever you'd like (integers or strings, it really doesn't matter) and have a repeating element in it. ex: let list = [1,2,3,1,4]; 


//Ok, now I know this is about arrays, but could you make a for loop to iterate through each element and print the index of them?






//Wait! You remember that repeating element I made you put in your list? Create a separate command outside of the loop to print the index of the last occurring repeated value.




Lesson 2 Homework - Part 2

%%js
//This is the fairly simple final problem of arrays!

//Create a list here that includes whatever you'd like once again.



//Now, print the length of your list! Tip: you don't need to create a variable for the list's length! Just console.log the list.length; it saves you a line :D



//Finally, create a variable to check if a value in your list is included in the list and print that variable you created (it should output true or false)


<IPython.core.display.Javascript object>

You’re done with your homework!!