# Help with error

**URL:** https://forum.makecode.com/t/help-with-error/36347
**Category:** Help
**Created:** [May 3, 2025, 10:54pm UTC](https://forum.makecode.com/t/help-with-error/36347 "2025-05-03T22:54:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![swirlix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/swirlix/32/34857_2.png) [@swirlix](https://forum.makecode.com/u/swirlix)
#### Post date: [May 3, 2025, 10:54pm UTC](https://forum.makecode.com/t/help-with-error/36347/1 "2025-05-03T22:54:37Z")

</div>

so I was making a game, then an error pops up on one of my blocks! I have no idea how to fix it, and I am very comfuzzled. here are some screenshots

 ![Screenshot 2025-05-03 15.46.13](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/8/f88b4c09ef393a75000761457bbdc663d43722bd.png)  
 ![Screenshot 2025-05-03 15.46.39](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/7/07edcf455f40c262c5d47614f542ed174eeb9ec3.png) here is the link [https://makecode.com/\_VqHekbRAfWuz](https://makecode.com/_VqHekbRAfWuz)  
I am using better arrays extension for this, and it works perfectly fine if I use “find index of” instead of that, so I’ma just ping Mr. @Sarge because he might know what’s going on.

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [May 4, 2025, 7:34pm UTC](https://forum.makecode.com/t/help-with-error/36347/2 "2025-05-04T19:34:57Z")

</div>

The “find occurrences of ()” block outputs an array of all the things it found. So to find the number of things it found, you can use “length of array”:

 ![IMG_8531](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/d/5d2a5a223c3144ceecc13390ebf35e5efbd66a6f.jpeg)

---

<div class="post-metadata">

### Author: ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)
#### Post date: [May 4, 2025, 9:38pm UTC](https://forum.makecode.com/t/help-with-error/36347/3 "2025-05-04T21:38:38Z")

</div>

Oh also @MakeCode it really seems like a bug that the error warning appeared there instead of on the yellow block. Idk if it is or not, but it’s certainly very weird imo.

---

<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 7, 2025, 6:50pm UTC](https://forum.makecode.com/t/help-with-error/36347/4 "2025-05-07T18:50:24Z")

</div>

Pro tip: all the functions in the extensions are fully annotated! So if you hover over a block it should give you a tip on what it returns.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/0/90ca7317c2c06bae61efb4671075981825f62540.png)

(as @WoofWoof pointed out, this block returns an array of indices, and you were comparing it to a single index)

Hope this helps in preventing some future issues!

---

<div class="post-metadata">

### Author: ![swirlix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/swirlix/32/34857_2.png) [@swirlix](https://forum.makecode.com/u/swirlix)
#### Post date: [May 7, 2025, 6:56pm UTC](https://forum.makecode.com/t/help-with-error/36347/5 "2025-05-07T18:56:59Z")

</div>

Thanks Mr @Sarge and @WoofWoof ! it works perfectly!
