# "IndexSignature not supported" error and Object.keys() not working

**URL:** https://forum.makecode.com/t/indexsignature-not-supported-error-and-object-keys-not-working/28994
**Category:** Help
**Created:** [May 29, 2024, 2:51am UTC](https://forum.makecode.com/t/indexsignature-not-supported-error-and-object-keys-not-working/28994 "2024-05-29T02:51:25Z")
**Posts on this page:** 1
**Showing post:** 2

<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 29, 2024, 9:32pm UTC](https://forum.makecode.com/t/indexsignature-not-supported-error-and-object-keys-not-working/28994/2 "2024-05-29T21:32:51Z")

</div>

Unfortunately, makecode uses _static typescript_, which [does not support](https://makecode.com/language) the behaviour you’re trying to accomplish.

> `Object.keys(x)` is not yet supported when `x` is dynamically a class type. It is supported when `x` was created with an object literal (eg., `{}` or `{ a: 1, b: "foo" }`). The order in which properties are returned is order of insertion with no special regard for keys that looks like integer (JavaScript has [really counter-intuitive behavior](https://www.stefanjudis.com/today-i-learned/property-order-is-predictable-in-javascript-objects-since-es2015/) here). When we support `Object.keys()` on class types, the order will be the static order of field definition.

I asked something like this a while back, same outcome

> [@How do I get names from objects instantiated from a class?](https://forum.makecode.com/t/how-do-i-get-names-from-objects-instantiated-from-a-class/24283):
>
> Basicaly, writing up an object with properties and fetching its keys with Object.keys() works fine. let foo = { bar: "abc", baz: () =\> {} } // Logs "bar", "baz" console.log(Object.keys(foo)); However, getting keys from a class instance just yields an empty array class Foo { bar: number; baz() { // code goes here } } // Expecting "bar", "baz" // Output is empty console.log(Object.keys(new Foo())); Why is this the case? Is there a way to achieve what I’m trying to…

---

_[View the full topic](https://forum.makecode.com/t/indexsignature-not-supported-error-and-object-keys-not-working/28994)._
