# Apparently \`getindex\` of a vector accepts more than one index?!

**URL:** <https://discourse.julialang.org/t/apparently-getindex-of-a-vector-accepts-more-than-one-index/113302>\
**Category:** General Usage\
**Tags:** indexing, array, arrays\
**Created:** [April 21, 2024, 11:54am UTC](https://discourse.julialang.org/t/apparently-getindex-of-a-vector-accepts-more-than-one-index/113302 "2024-04-21T11:54:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [April 21, 2024, 11:54am UTC](https://discourse.julialang.org/t/apparently-getindex-of-a-vector-accepts-more-than-one-index/113302/1 "2024-04-21T11:54:40Z")

</div>

Why doesn’t this throw, given that the array `[10, 20]` is one-dimensional? I would expect a `MethodError`.

```julia-repl
julia> [10, 20][1, 1, 1]
10

```

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [April 21, 2024, 12:06pm UTC](https://discourse.julialang.org/t/apparently-getindex-of-a-vector-accepts-more-than-one-index/113302/2 "2024-04-21T12:06:59Z")

</div>

This is documented:

[https://docs.julialang.org/en/v1/manual/arrays/#Omitted-and-extra-indices](https://docs.julialang.org/en/v1/manual/arrays/#Omitted-and-extra-indices)

Probably it wouldn’t hurt to have a short explanation of why that’s convenient. I remember reading discussions about that here.
