Use a loop and some testing statement like an if

What is an "empty location"? That will depend on the data type in the array.