The for…in statement is used for looping through the elements of the array.
for (variablename in arrayname)
………… //Block of Code to be executed
The output of the above example is
In the above example, the variable name defined inside the for..in statement is A, which is used as an index for moving through the array Exforsys.
Combining Operations between arrays and within elements of an array:
It is possible to perform various operations between arrays and within elements of an array. One of these is the combining operation, which uses two aspects:
* Joining Two or more arrays
* Joining elements of a array
Joining two or more arrays:
The operation of Joining Two arrays can be performed using the predefined function concat( ).
The general format of concat( ) is:
The output of the above script is
In the above example we have concatenated elements of two arrays.
Joining elements of an array:
The general format of join( ) method is as follows:
In the above example, the parameter given is dot( . ), then each element of the joined array would be separated with a dot.
gives output as
The parameter given in join is optional.