getNames function

Get element names from list.