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 8943205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:43:00+00:00 2026-06-15T11:43:00+00:00

Is it a method in backbone that will take a collection of models and

  • 0

Is it a method in backbone that will take a collection of models and made an array of model id’s or any other specified attribute in the model?

I’m able to list the model’s is’s in the console.log but unsure how to make an array from it

for (var i=0; i<collection.models.length; i++){ 
   console.log(collections.models[i].id) 
}
  • 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-06-15T11:43:01+00:00Added an answer on June 15, 2026 at 11:43 am

    You can use the Underscore method pluck for this:

    collection.pluck("id");
    

    http://jsfiddle.net/upqqL/


    Description of pluck from the UnderscoreJS docs:

    A convenient version of what is perhaps the most common use-case for map: extracting a list of property values.

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

Sidebar

Related Questions

When you override backbone sync, both model/collection .save()/fetch() uses the same backbone sync method,
I have a Backbone collection with a load of models. Whenever a specific attribute
I've got a Backbone model with a custom validate method that validates the format
I've extended the Backbone Collection class to include a save method, which is essentially
I'm trying to make a quick sample Backbone.js app that has a Post model,
I have a backbone collection on the client. Model of the collection has some
I have a backbone router that has @collection = new Backbonedemo.Collections.Posts() @flashes = new
I've got a simple Backbone collection that pulls a list of objects from a
I have noticed that when multiple attributes of a Backbone model are set like
Trying to create a backbone plugin that inherits from Backbone.Model but overrides the sync

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.