Code with array and function still not working

I am close trying to work out the code on this function