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

  • Home
  • SEARCH
  • 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 8760919
In Process

The Archive Base Latest Questions

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

I know backbone is somewhat depending on underscore and jquery. Is there difference between

  • 0

I know backbone is somewhat depending on underscore and jquery. Is there difference between the two lines below?

app.notifications = _.extend({}, Backbone.Events);

AND

app.notifications  = Backbone.Events.extend({});

If they are NOT the same, how different?

  • 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-13T15:09:46+00:00Added an answer on June 13, 2026 at 3:09 pm

    Backbone.Events.extend does not exist,
    so I will refer to Backbone.Model instead.

    _.extend(target, mixin1, mixin2) is going to copy properties into the target object

    Backbone.Model.extend is going to subclass Backbone.Model basically make a constructor (function) whose prototype has your provided properties. This will allow you to make instances of your new class

    var Person = Backbone.Model.extend({name: 'yourName'});
    var me = new Person();
    alert(me.name);
    

    while _.extend would fail

    var Person = _.extend({name: 'yourName'}, Backbone.Model);
    var me = new Person();  //error b/c Person is a regular object
    alert(me.name);
    

    In short Backbone.Model.extend creates a new constructor (function), while _.extend modifies an existing object;

    var modified = {};
    alert(modified === _.extend(modified, Backbone.Model)); //true
    alert(modified === Backbone.Model.extend(modified)); //false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know i am doing something stupid but my backbone marionette app is giving
To learn backbone Im creating a Twitter like app. So you know that Twitter
I know that I can use jQuery to access the view's element in backbone.js
Currently I am using backbone-rails in my Rails app. I would like to know
I am using backbone.js (0.5.3) with JQueryMobile (1.0 beta 2). I know there are
I'm trying to learn Backbone by looking at an app that someone I know
Does anyone know which event is fired after a view is rendered in backbone.js?
I need to override Backbone.sync to allow PUT the problem is i don't know
I'm building a backbone.js application, and don't quite know where to put my templates.
I know there have been many questions on grid and pack in the past

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.