Assume you have created an array of pets:
var mypets = new Array();
mypets = “dog”;
mypets = “cat”;
mypets = “goldfish”;
- a)Add a for loop to print out the array
- b)Write a fragment of code to insert a new pet named ‘turtle’to the end of mypets array .
- c)Write a fragment of code to removes the pet named ‘turtle’ from mypets array