Unable to extract values from object array, to which javascript array was deserialized

Jude
var serializedArray = new JavaScriptSerializer().Deserialize<object[]>(filter);

The content of the variable filter is [["Title","contains","foo"],"and",["Name","contains","foo"]].

Content of serializedArray is "object[3]","and","object[3]".

Content of serializedArray[0] is object[3] which are "Title", "contains", "foo".

serializedArray can be used with index operator, and foreach is applicable. But not for serializedArray[0].

Funny enough, both the serializedArray and serializedArray[0] have the type of Object[]. What's the way to grab the value "Title" or "Name"?

hpatel
           var serializedArray = new JavaScriptSerializer().Deserialize<object[]>(filter);

            foreach (var item in serializedArray)
            {
               if (item is string)
               {
                  var element = item;
               }
               else
                  foreach (var innerItem in (object[])item)
                  {
                     var element = innerItem;
                  }
            }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Extract Object Values into an Array

From Dev

Extract key values from one Array object and filter from other objects with the extracted values with underscore javascript

From Dev

Unable to get values from JSON Array and Object

From Dev

Unable to get the values from JSON Array and Object

From Dev

Unable to get values from JSON Array and Object

From Dev

Add values from Object in Array Object in Javascript

From Dev

How to parse a string from servlet to javascript and created a formatted object which contains array values

From Dev

Creating javascript object from array values

From Dev

Sending values from an array of object to a function in JavaScript

From Dev

Transfer Values from Object to an Array - Javascript

From Dev

Javascript Array Object And Values

From Dev

PHP extract values from array

From Dev

Extract "N" Values from an Array

From Dev

Extract "N" Values from an Array

From Dev

Extract values from JSON array

From Dev

Extract values from dynamic array

From Dev

javascript object get array of values from array of keys

From Dev

Extract values from input fields and store in javascript array

From Dev

Extract array from object with jQuery

From Dev

Extract data from an array of Object

From Dev

how to extract value from the json response which is under array and array is under object

From Dev

How to get values from Deserialized JSON object?

From Dev

Javascript get values from multidimensional array object by other values

From Java

Omit keys from an object which are present in another array in javascript

From Dev

Unable to interpolate an array which is inside of an object property

From Java

copy values from Object[,] Array to Object[][] Array

From Dev

Javascript Sum array of object values

From Dev

javascript object array into a list of values

From Dev

angularjs - javascript - Convert object values from array to string

Related Related

  1. 1

    Extract Object Values into an Array

  2. 2

    Extract key values from one Array object and filter from other objects with the extracted values with underscore javascript

  3. 3

    Unable to get values from JSON Array and Object

  4. 4

    Unable to get the values from JSON Array and Object

  5. 5

    Unable to get values from JSON Array and Object

  6. 6

    Add values from Object in Array Object in Javascript

  7. 7

    How to parse a string from servlet to javascript and created a formatted object which contains array values

  8. 8

    Creating javascript object from array values

  9. 9

    Sending values from an array of object to a function in JavaScript

  10. 10

    Transfer Values from Object to an Array - Javascript

  11. 11

    Javascript Array Object And Values

  12. 12

    PHP extract values from array

  13. 13

    Extract "N" Values from an Array

  14. 14

    Extract "N" Values from an Array

  15. 15

    Extract values from JSON array

  16. 16

    Extract values from dynamic array

  17. 17

    javascript object get array of values from array of keys

  18. 18

    Extract values from input fields and store in javascript array

  19. 19

    Extract array from object with jQuery

  20. 20

    Extract data from an array of Object

  21. 21

    how to extract value from the json response which is under array and array is under object

  22. 22

    How to get values from Deserialized JSON object?

  23. 23

    Javascript get values from multidimensional array object by other values

  24. 24

    Omit keys from an object which are present in another array in javascript

  25. 25

    Unable to interpolate an array which is inside of an object property

  26. 26

    copy values from Object[,] Array to Object[][] Array

  27. 27

    Javascript Sum array of object values

  28. 28

    javascript object array into a list of values

  29. 29

    angularjs - javascript - Convert object values from array to string

HotTag

Archive