3

The JavaScript:

[a,b] = [b,a];

The Eclipse error:

The left-hand side of an assignment must be a variable

Is there some plugin or something I need in order to get Eclipse to correctly inspect JavaScript?

3
  • 2
    That's not valid JavaScript 1.5 (what's used in browsers) so it's flagging it. Commented Jul 4, 2012 at 22:34
  • 1
    Destructuring assignment is not part of the current ECMAScript standard. Try running that in anything other than Firefox. Commented Jul 4, 2012 at 22:35
  • 2
    If you're interested, you can read the Harmony proposal for it. Commented Jul 4, 2012 at 22:43

1 Answer 1

2

It's only valid in Mozilla's JavaScript implementation, found in Firefox for example.

Technically this is actual "JavaScript" according to a more technical definition of the word, but it's currently not valid "ECMAScript", which is usually what people are talking about when they use the word "JavaScript".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.