programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Website by URL, How to Play YouTube Videos in by using Jquery , Jquery Change div background on mouseover in , JQuery UI Datepicker (Calendar) etc.

Tuesday, December 30, 2014

Comma operator in JavaScript

Comma operator in

The comma operator evaluates each of its operands (from left to right) and returns the value of the last operand.

Syntax of Comma operator:

expr1, expr2, expr3...

expr1, expr2, expr3...
Any expressions.

Description of Comma operator:

You can use the comma operator when you want to include multiple expressions in a location that requires a single expression. The most common usage of this operator is to supply multiple parameters in a for loop.

Comma operator Example:

If a is a 2-dimensional array with 10 elements on a side, the following code uses the comma operator to increment two variables at once. Note that the comma in the var statement is not the comma operator, because it doesn't exist within an expression. Rather, it is a special character in var statements to combine multiple of them into one. Practically, that comma behaves almost the same as the comma operator, though.

The code prints the values of the diagonal elements in the array:

for (var i = 0, j = 9; i <= 9; i++, j--)

  document.writeln("a[" + i + "][" + j + "] = " + a[i][j]); 

Other Related Post on this tutorial:

     ·          How to Bind gridview form database.·         Show gridview Row Details in·         Template field in gridview Example·         Introduction of grid view Control.·         Example of Templatefield in gridview.·         Example of  DropDownList  inside gridView· grid viewControl Programming.·         Checkbox within Asp.Net gridView·         Ckeckbox list Example using JavaScript in   gridview. · textbox control in inside of gridview·         How to Bind Gridview Form database.·         Show gridview Row Details And Give Example.·         Example of Templatefield in gridview.·         Example of DropDownList inside GridView control·         Introduction of grid view Control.·         Example of C# for Bind Data to Textbox inside gridview control·         Bind Data to textbox control in inside of gridview Using C# Example·         ListView.LayoutTemplate Property·         How to use table for ListView layout in·         How to use table layout in ListView control in ASP.Net·         How to use Asp ListView control in·         ASP.NET ListView Demo Data and layout templates ·         Checkboxlist control in asp net·         Example of Adding ToolTip for each Dropdown List Item in C#

No comments:

Post a Comment