1

can you explain how did this assignment is work,

var fe, f = document.forms[0], h;

which one equal to which one.

1

1 Answer 1

9

Above is equivalent to

var fe;
var f = document.forms[0];
var h;

Basically, the 'comma' ends one declaration and starts another. fe and h would be undefined after the above statement whereas f will be set to first form in the document.

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

2 Comments

Thanks CMS, I corrected my post. My C# and JS knowledge gets me confused!
You're welcome SolutionYogi, and you're not alone!, that also happens to me sometimes...

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.