# e.findIdx is not a function error when accessing a value in a tuple

**URL:** https://forum.makecode.com/t/e-findidx-is-not-a-function-error-when-accessing-a-value-in-a-tuple/28937
**Category:** Help
**Created:** [May 24, 2024, 3:27pm UTC](https://forum.makecode.com/t/e-findidx-is-not-a-function-error-when-accessing-a-value-in-a-tuple/28937 "2024-05-24T15:27:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ARandomGuyOnMakeCode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/arandomguyonmakecode/32/22983_2.png) [@ARandomGuyOnMakeCode](https://forum.makecode.com/u/ARandomGuyOnMakeCode)
#### Post date: [May 24, 2024, 3:27pm UTC](https://forum.makecode.com/t/e-findidx-is-not-a-function-error-when-accessing-a-value-in-a-tuple/28937/1 "2024-05-24T15:27:14Z")

</div>

I was trying to access a value in a tuple, but when I do, I get the “e.findIdx is not a function” error. This doesn’t happen when I do the same thing with an array, just a tuple.

Here is an example of what I’m trying to do:

```auto
let exampleTuple: [number,number] = [5,6]
let value: number = exampleTuple[0]

```

I honesty have no clue what is wrong. All help is appreciated.

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [May 25, 2024, 6:01pm UTC](https://forum.makecode.com/t/e-findidx-is-not-a-function-error-when-accessing-a-value-in-a-tuple/28937/2 "2024-05-25T18:01:39Z")

</div>

This is usually a typing issue so throwing casts at it should eventually fix it.

```auto
let exampleTuple: [number,number] = [5,6]
let value: number = (exampleTuple as any[])[0]

```

Here you cast the tuple to an any array before accessing it. Didn’t test it but it should work

---

<div class="post-metadata">

### Author: ![ARandomGuyOnMakeCode](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/arandomguyonmakecode/32/22983_2.png) [@ARandomGuyOnMakeCode](https://forum.makecode.com/u/ARandomGuyOnMakeCode)
#### Post date: [May 27, 2024, 6:47pm UTC](https://forum.makecode.com/t/e-findidx-is-not-a-function-error-when-accessing-a-value-in-a-tuple/28937/3 "2024-05-27T18:47:13Z")

</div>

Worked like a charm! Thank you very much 🙂.
