Is it possible to use a loop variable to target a specific field entry? I'm looping through the rows of a table field and hoping to target a specific field entry based on the loop.index. Here's a simplified example of what that might look like:

{% for row in entry.table %}   
   {% set foo = entry.field ~ loop.index %}
{% endfor %}


The doesn't work, but I’m curious if I just have the syntax wrong or if I’m thinking about this the wrong way.
Turns out Twig has a nifty little attribute function that does the trick. Here's how it works:

{% for row in entry.table %}   
   {% set foo = attribute(entry, 'fieldHandle' ~ loop.index) %}
{% endfor %}


Big hat tip to Mr. Brad Bell for posting the original answer in Stack Exchange.