Create an Array in Twig and loop through fields in global set
Seems like a great use case for a Twig macro.  Completely untested, but something like this:

{% macro social(object, type) %}

    {% set value = attribute(object, type) %}

    {% if value | length %}
        &lt;li&gt;&lt;a href="{{ value }}" target="_blank"&gt;&lt;i class="fa fa-{{ type }}" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
    {% endif %}
{% endmacro %}

{% import "myMacros.html" as myMacros %}

{% set socialArray = ['facebook', 'twitter', 'instagram', 'vimeo', 'youtube'] %}

{% for socialType in socialArray %}
    {{ myMacros.social(socialMedia, socialType) }}
{% endfor %}