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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:42:57+00:00 2026-06-15T20:42:57+00:00

I was just wondering some OO while reading backbone’s source. http://backbonejs.org/docs/backbone.html (search for this.parse(attributes);)

  • 0

I was just wondering some OO while reading backbone’s source.
http://backbonejs.org/docs/backbone.html (search for “this.parse(attributes);”)

  Backbone.Model = function(attributes, options) {
var defaults;
attributes || (attributes = {});
console.log('attributes : ', attributes);
if (options && options.parse) {
  //LOOK HERE
  attributes = this.parse(attributes);
}
if (defaults = getValue(this, 'defaults')) {
  attributes = _.extend({}, defaults, attributes);
}
if (options && options.collection) this.collection = options.collection;
this.attributes = {};
this._escapedAttributes = {};
this.cid = _.uniqueId('c');
if (!this.set(attributes, {silent: true})) {
  throw new Error("Can't create an invalid model");
}
delete this._changed;
this._previousAttributes = _.clone(this.attributes);
this.initialize.apply(this, arguments);

};

how does it come that parse can be used there in the prototype ?
the method is defined later in _.extend(Backbone.Model.prototype, Backbone.Events, {

  • 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-15T20:42:58+00:00Added an answer on June 15, 2026 at 8:42 pm

    The code that you see in function is going to be executed when someone is doing

    new Backbone.Model
    

    By that time, Backbone.Model.prototype will be defined as well. So property lookup will find parse method on this.constructor.prototype (where this will be pointing at just created instance of Backbone.Model).

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

Sidebar

Related Questions

Just wondering about some practice about this; I have made a simple visual C#
Just wondering if anyone else has spotted this: On some user's machines running our
Just wondering if they are the same thing since some programmers say scope while
Just wondering if anyone has some good resources for learning how to create new
Just wondering what the best way to build a NSPredicate is if some filters
I am just wondering if anyone know of some good tutorials on the Internet
Just trying to canvas some opinions here. I was wondering how people go about
Some assertions in my code just started acting strangely, and I was wondering if
While doing some casual reading I came across an interesting quote by Scott Meyers
Just wondering if I could gather some constructive comments. Well, I am developing a

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.