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

Unfortunately, makecode uses static typescript, which does not support 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 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

2 Likes