Added a For loop and a forEach loop to iterate through arrays and list the names and index