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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:41:30+00:00 2026-05-15T13:41:30+00:00

Yeah, it works in my firebug console. Why does something like this present no

  • 0

Yeah, it works in my firebug console. Why does something like this present no syntax error?

[] = 5; [] = doThis(); [] = (function() {})();

Just curious about why it’s allowed.

  • 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-15T13:41:31+00:00Added an answer on May 15, 2026 at 1:41 pm

    Looks like Javascript in FF allows assignment using matching so you can set multiple variables in one shot:

    [x,y] = [5,6]; // sets x to 5 and y to 6
    

    “Obviously”, some JS implementations are very forgiving, and will silently ignore any extra values, so this does the same:

    [x,y] = [5,6,7];
    

    and this would just not assign anything:

    [] = [5,6,7];
    

    and on top of that, it looks like FF is even willing to go with a case that doesn’t match an array at all:

    [x] = 5; // makes x undefined
    

    so if you use [] = whatever then “nothing gets assigned an undefined value”, so it boils down to just evaluating the RHS.

    (Disclaimer: this is all just guessing the meaning by running stuff in FF…)

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

Sidebar

Related Questions

Yeah this works in FF and Chrome, but for some reason wont work in
So yeah, like I said, I've spent a few hours trying to fix this
This code works, in some cases. If it returns console.log then the call to
I have this query that works just fine, however I want to change my
This shows what I have and want: So yeah as you can see I
While I'm busy here reading the FastCGI documentation (yeah, reading the 'friendly' manual), does
I'm using the: console.log() method to log messages to firefox (3.6.6)/firebug while working on
Yeah, so this one through me or a loop for a while until I
I'm using google font api, this code works when I move the font-family line
This might seem like a basic question and back to Http protocol 101. But

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.