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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:08:56+00:00 2026-06-08T11:08:56+00:00

The backbone.js source code uses a function wrapper like this: (function(){ … }).call(this); as

  • 0

The backbone.js source code uses a function wrapper like this:

(function(){
    ...
}).call(this);

as seen at http://backbonejs.org/docs/backbone.html#section-185.

Much more often, I’ve seen the following used instead:

(function(){
    ...
})();

When does the behavior of these two differ? I was under the impression that they were equivalent, but I assume that there must be a difference given that Backbone uses .call(this) instead of the shorter alternative.

  • 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-08T11:08:58+00:00Added an answer on June 8, 2026 at 11:08 am

    In the first example, this inside of the function will be the this from the calling scope.

    In the second example, this will be window.

    (As noted by Šime Vidas, it’s undefined in strict mode, rather than window.)

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

Sidebar

Related Questions

Reading through the Backbone.js source code, I saw this: validObj[attr] = void 0; What
What is options in Backbone.js that I see all over the official source code
I am working on an open source javascript project using backbone that uses a
In backbone.js under the inherits method, the authors does this: var ctor = function()
My backbone.js model has a json object in defaults like this: test: { testArr:
I just stumbled upon something I've never seen before. In the source of Backbone.js's
The backbone.js annotated source describes the following piece of code var Backbone; if (typeof
This may seem like a really off-the-wall question, but I've been learning how Backbone.js
var homeView = Backbone.View.extend({ el: $(#main_container), initialize: function(){ _.bindAll(this, 'render'); }, render:function(){ $.get('/home', {},
I'm reading someone's source code for their backbone app and trying to figure out

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.