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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:14:38+00:00 2026-05-27T09:14:38+00:00

According to my tests it is always left-to-right >> console.log( console.log(1), console.log(2) ); 1

  • 0

According to my tests it is always left-to-right

>> console.log( console.log(1), console.log(2) );
1
2
undefined undefined

but I can’t find the relevant section confirming this in the ECMAScript standard.

  • 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-27T09:14:38+00:00Added an answer on May 27, 2026 at 9:14 am

    All the operators in JavaScript evaluate their operands left-to-right, including the function call operator. First the function to call is evaluated then the actual parameters in left-to-right order.

    Section 11.2.3 is the relevant spec section.

    11.2.3 Function Calls

    …

    2 Let func be GetValue(ref).

    3 Let argList be the result of evaluating Arguments, producing an internal list of argument values (see 11.2.4).

    …

    and you can see that the ArgumentList production is left-recursive

    11.2.4 Argument lists

    …

    The production ArgumentList : ArgumentList , AssignmentExpression is evaluated as follows

    and ArgumentList is evaluated before AssignmentExpression in the following verbiage..

    Under EcmaScript 3 some of the comparison operators (<, <=, >, >=) evaluated right to left since a<=b was defined in terms of !(b<a), but that was widely recognized as a spec error, major interpreters did not implement it that way, and it was fixed in EcmaScript 5.

    From the language spec:

    11.8.5 The Abstract Relational Comparison Algorithm # Ⓣ

    The comparison x < y, where x and y are values, produces true, false, or undefined (which indicates that at least one operand is NaN). In addition to x and y the algorithm takes a Boolean flag named LeftFirst as a parameter. The flag is used to control the order in which operations with potentially visible side-effects are performed upon x and y. It is necessary because ECMAScript specifies left to right evaluation of expressions. The default value of LeftFirst is true and indicates that the x parameter corresponds to an expression that occurs to the left of the y parameter’s corresponding expression. If LeftFirst is false, the reverse is the case and operations must be performed upon y before x. Such a comparison is performed as follows:

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

Sidebar

Related Questions

According to my small tests this code works. But, does it have undefined behaviour?
According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when
I appreciate TDD and think it indispensable but always write my tests ONLY after
The operator precedence table I can find is: https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence according to the table, both
According to this discussion , the iphone agreement says that it doesn't allow loading
According to what I have found so far, I can use the following code:
According to the answers to this question, I cannot embed a file version in
According to the javadocs, Groovy's MockFor object always ends with a verify. Its StubFor
According to MSDN on DateTime.ToString ToString(s) should always return string in the format of
According to another question I can select individual XML fields with a YQL query

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.