Getting an array of ids from an array of eager-loaded elements within Twig I have been using the ids() method on the ElementCriteriaModel returned by a call to an entries field within a Twig template to return an array of ids for further processing. 

Now I wish to eager-load these entries, but the entries are returned as an array with no access to the ids() method.

Is there an efficient way to get this array of ids within Twig, or would I be better moving this to a plugin?
You would just loop the entry models to collect the IDs (looks ugly, but it's a simple and efficient for loop). But in case you do not need anything else from the models, I'd actually expect your previous approach using the ids method to have better performance.

{% set ids = [] %}
{% for entry in entry.myEagerLoadedEntries %}
    {% set ids = ids|merge([entry.id]) %}
{% endfor %}