Slightly related, I've added an Object.keys function to the scripting API. Also works on arrays but will return an empty array in that case.
Link Preview Image Added Object.keys by davidhealey · Pull Request #695 · christophhart/HISE faviconGitHub (github.com)