Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to distinguish "Standard Array" to "Associative Array" #246

Open
RobinHood-80 opened this issue May 23, 2021 · 1 comment
Open

Way to distinguish "Standard Array" to "Associative Array" #246

RobinHood-80 opened this issue May 23, 2021 · 1 comment

Comments

@RobinHood-80
Copy link

Hi,
Suppose I have a function in Javascript that returns:

a) [1,2,3]
or
b) {"0": 1, "1": 2, "2": 3}

in c# i can see this value as represented by an instance of a JSValue class

In both situations i see the JSValue as an associative array (like b)
I need a way to know if the object returned is a conventional array or an associative set.

Is there a way to achieve this?

@nilproject
Copy link
Owner

Hi.
Try to use .As<Array>(), which defined in Extensions namespace. Or Array.isArray()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants