Access page children array by index

I have an array of pages that can be accessed by using a for loop. Somehow trying to access elements by index is not working.

{% set posts = page.find('/blog').children.order('date', 'desc').slice(0, 3) %}
{% for post in posts %}
   {{ post.url }} // this works fine
{% endfor %}
{{ posts[0].url }} // this does not work

Any suggestion on what I am doing wrong?

You can only access by index within a loop, elsewhere the index does not exist. If you are trying to access the first item of an array, use the |first filter like so: {{ [1, 2, 3, 4]|first }}.