You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are correct that JSON keys (and all javascript keys) are strings. On the other hand, since javascript coerces keys to strings, a key of any type becomes valid JSON. For example:
typeObj={[key: string]: any};constobj: Obj={'3': 'test'};console.log(obj[3]);// coerced into "3" and returns "test", but flow errors "number is incompatible with string"
Currently gets converted into
However, in reality json keys can ONLY be string. So the correct type should be
The text was updated successfully, but these errors were encountered: