Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7536999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:43:43+00:00 2026-05-30T06:43:43+00:00

my json string is as follows: var data = [{first:3,second:1},{first:5,second:5},{first:7,second:1}]; Now i am calling

  • 0

my json string is as follows:

var data = [{"first":"3","second":"1"},{"first":"5","second":"5"},{"first":"7","second":"1"}];

Now i am calling –

objx(data).collect("first") 

and expecting to get an array like [3,5,7].
But i am getting javascript error : object doesn’t support this property or method.
i have tried with

objx(data).collect("first").obj() but with no avail.

i have included objx-2.3.6.js file from http://code.google.com/p/objx/ and i want to create the array with objx api to reduce no of lines of code.
i am using IE8

please suggest a way out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:43:45+00:00Added an answer on May 30, 2026 at 6:43 am

    “my json string” – That’s neither JSON nor a string. Anyway…

    Since you’ve tagged your question with jQuery (even though you don’t mention it in your question anywhere) here is a jQuery solution to the same problem:

    var fields = $.map(data, function(val) { return val.field; });
    // fields is [3,5,7]
    

    As far as why you’re getting the particular error you do, that would be because the .collect() method is not part of the core objx library, at least, it is not in objx-2.3.6.js. Presumably you need to include the Collections plugin js too (but I couldn’t find it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When i try to read a JSON string like below it goes to endless
I'm using the following code to get some json formatted data: $.ajax({ type: GET,
I am creating a JSON array exactly as follows (bar using mathrandom). For example
I have a JSON string and I'd like to use to compose an object.
I have JSON as follows: [{0:1,id:1,1:abc,name:abc},{0:2,id:2,1:xyz,name:xyz}] It is an array of objects. I need
I'm using Newtonsoft.Json.Linq and I'd like to load the data into objects (or structs)
I'm loading a JSON string in Django using simplejson , thus: obj = json.loads('{name:
I have a json string saved in my db. When i retrieve it from
I'm getting this json string info from the server : {members:[[sd2840d,Johny],[jkld341,Marry]]} So I store
Take the following JSON string (generated by some ExtJS code - but that's irrelevant):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.