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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:46:08+00:00 2026-06-14T20:46:08+00:00

The expression inside the following function is evaluated right to left function foo(){ var

  • 0

The expression inside the following function is evaluated right to left

function foo(){

var a = b = c;

}

so it’s like it was typed this way

var a = (b = 0)

However, when methods are chained together, they are read left to right. The methods in this object…

var obj = {
   value: 1,
   increment: function () {
       this.value += 1;
       return this;
  },
  add: function (v) {
      this.value += v;
     return this;
  },
  shout: function () {
      alert(this.value);
  }
};

can be called like this, evaluated left to right

obj.increment().add(3).shout(); // 5

// as opposed to calling them one by one

obj.increment();
obj.add(3);
obj.shout(); // 5

So, I think I know when to read left to right and right to left, but is there a rule that I need to know which I don’t know?

  • 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-14T20:46:10+00:00Added an answer on June 14, 2026 at 8:46 pm

    Rule is called ‘operator associativity’ and is, along with operator precedence, a property of every operator (arithmetic, member access, be it unary or binary, etc.) in most of languages. Associativity is usually defined by language specs, and can often be found in books, tutorials, cheatsheets, and so on. One of first google results for javascript is here: http://www.javascriptkit.com/jsref/precedence_operators.shtml

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

Sidebar

Related Questions

Is there a way to dereference a placeholder inside lambda expression ? boost::function<int(MyClass*)> f
I've got the following jQuery expression, Inside the function I need a reference to
I have a string like the following rotate(32) translate(0,-284.35468),translate(8545,84) matrix(d,f,g,s,g) translate(-58,88) Each function can
Is there any way that regular expression match inside a if block would interfere
I have the following text (inside some more text): {movie:http://www.film.com/films/film1} I would like to
I installed and tried out tweepy, I am using the following function right now:
I would like to use is_flag_active() function inside one of my state's on_entry template
I have a function that returns the following type: IEnumerable<IGrouping<String, ExportTransaction>> In this function
Consider the following code: (function() { var a = 5; var someFunc = function()
Can a regular expression be used inside a stored procedure? If it can, how?

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.