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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:21:45+00:00 2026-06-13T12:21:45+00:00

First – I’m new to Backbone, so bear with the possibly stupid nature of

  • 0

First – I’m new to Backbone, so bear with the possibly stupid nature of this question. I have a model:

var AppModel = Backbone.Model.extend({

    defaults: {
        mynumber: null
    }

});

I can successfully add items dynamically to the collection (console.log shows that they’re going in fine), but I’m just not sure how to pull them out, here’s what I’m trying:

printCollection: function(){
    this.collection.each(function(item){
        console.log(item.mynumber);
    });
}

Which shows the number of items and undefined.

  • 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-13T12:21:46+00:00Added an answer on June 13, 2026 at 12:21 pm

    You need to use the attribute accessor, not the value.

    item.get('mynumber');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First I want to say, I'm sorry if this question have be asked already
first take a look on this picture from localScope app : i have 2
first sorry if its a stupid question but im lost a bit. So when
First of all, I am sorry if this question doesn't belong to SO since
First, my question might sound like a duplicate, but I have been going through
First of all, regular expressions are quite possibly the most confusing thing I have
First off, I am a totally new developer with regards to Node.js. I have
First off, this is my first project using SQLAlchemy, so I'm still fairly new.
First let me say that I really feel directionless on this question. I am
First things first, I'm aware of this question: Gearman: Sending data from a background

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.