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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:03:01+00:00 2026-05-31T12:03:01+00:00

While investigating google plusone scripts, I’ve seen following syntax many times: (0, _.Em)(); Assuming

  • 0

While investigating google plusone scripts, I’ve seen following syntax many times:

(0, _.Em)();

Assuming _.Em is a function the statement above would result in calling that function, that’s pretty obvious. If, on the other hand, it would be undefined, wouldn’t the result be the same as doing simply _.Em() ?

Can anyone shed a light on what’s idea behind using such syntax?

  • 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-05-31T12:03:02+00:00Added an answer on May 31, 2026 at 12:03 pm

    Basically, this syntax allows to call _.Em() in the context of the window object instead of _.

    Assuming you have this code:

    Foo = function() {
        this.foo = "foo";
    };
    
    Foo.prototype.Em = function() {
        alert(this.foo);
    };
    
    var _ = new Foo();
    

    Issuing _.Em() will result in Em() being called in the context of _. Inside the function, the this keyword will refer to _, so foo will be printed.

    Issuing (0, _.Em)() decouples the method call from the object and performs the call in the global context. Inside the function, the this keyword will refer to window, so undefined will be printed, since window does not have a foo property.

    You can test the difference between the two syntaxes in this fiddle.

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

Sidebar

Related Questions

I'm investigating a stack trace (seen while debugging) that looks something like the following:
While investigating a crash, I came across the following code snippet and immediately recognized
While investigating a reported problem with my site loading slowly, I came across an
While investigating an issue with application I'm working on, I've came across one behavior
I have been looking at monotorrent and while investigating the whole bittorrent thing I
While I was investigating a problem I had with lexical closures in Javascript code,
Been investigating for a while now and keep hitting a brick wall. I am
While going through university and from following the development of SO, I've heard a
While I've seen rare cases where private inheritance was needed, I've never encountered a
I am doing investigation on filestream (asking on stackoverflow while reading whitepapers and google

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.