If you want to use a looping iteration functionality in x.html.twig you can use the following:

{% if content %}
  <div class="parent"> 
    {% for item in content %}
      <div class="child-wrap">{{ item }}</div>
    {% endfor %}
  </div>
{% endif %}

or

<ul{{ attributes }}>
  {% for item in items %}
    <li>{{ item.content }}</li>
  {% endfor %}
</ul>

or

<ul>
  {% for i in content.field_foo['#items']|keys %}
    <li>{{ content.field_foo[i] }}</li>
  {% endfor %}
</ul>
{% for key,value in node.my_paragraph_field.value %}
    {{ content.my_paragraph_field[key] }}
{% endfor %}

Extra: loop over paragraph values that are inside a paragraph:

{% for i in paragraph.field_numbers|keys %}
    <li>
        <div class="label">{{ paragraph.field_numbers[i].entity.field_label.value }}</div>
        <div class="number">{{ paragraph.field_numbers[i].entity.field_number.value }}</div>
        <p>{{ paragraph.field_numbers[i].entity.field_text.value|raw }}</p>
    </li>
{% endfor %}

 

 

Saved you some valuable time?

Buy me a drink 🍺