JavaScript Comma Operator
JavaScript Comma Operator
The comma
operator evaluates each of its operands (from left to right) and returns the value of the last operand.
Example
More Examples
In the following example, the comma operator saves the repetition of the keyword (var).
Example
In the following example, the comma operator is used for concatenating a string and a variable.
Example
In the following example, the comma operator is used to execute multiple functions when the condition in the conditional operator returns true.
Example
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.