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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:09:08+00:00 2026-06-09T01:09:08+00:00

I am reviewing some code for a JavaScript widget that I downloaded and there

  • 0

I am reviewing some code for a JavaScript widget that I downloaded and there is a variable assignment similar to the following:

var a = a.something || a.somethingElse, c, d, e, f, g;

What I am wondering is if this is equivalent to this:

var a = a.something || a.somethingElse;
var c, d, e, f, g;

or this:

var a = a.something || a.somethingElse || c || d || e || f || g;

I have been reading up on short-circuit evaluation and assignments, and I understand that the first part is saying:

if ( a.something != (null or 0 or false)) {
    a = a.something;
} else {
    a = a.somethingElse;
}

but I cannot seem to find any resources that use an example like this one.

Thanks, for your help!

  • 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-09T01:09:10+00:00Added an answer on June 9, 2026 at 1:09 am

    Your understanding is correct. A comma seperated list in a var statement is treated like individual Ines.

    As for the boolean OR statement: If the first expression is falsy, the second will be used. You can add more, as in your third example.

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

Sidebar

Related Questions

Here's the situation. I'm reviewing some SDK code that I didn't write because I've
I'm reviewing some legacy code and I've found a bug that causes the response
When reviewing code I came across something odd, someone had read that you can
Reviewing some code that contains a bunch indirectly nested transactionscopes. I would like to
I'm reviewing some code, and saw something I have never seen before. I did
I have been reviewing some code that looks like this: class A; // defined
I was reviewing some of my old code and I have a method that
I'm reviewing some code for a friend and say that he was using a
I'm reviewing some javascript code and the programmer uses >> in a few places.
I was recently reviewing some Javascript code in a jQuery plug-in and came across

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.