JavaScript Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Java-Script Tutorial
Introduction Introduction
Variables Variables
Operators Operators
Statements Statements
Loops Loops
Functions Functions
Objects Objects
Arrays Arrays
Cookies JS Cookies
Browser Objects Browser Objects
Form DOM Form DOM
Style Objects DOM Style Objects
Forums Ask Your Doubts
Scraps More about Javascript
Feedback Feedback
 




Javascript concat() Method - Array Function


Tutorials Javascript

Topic

How can we concat the elements in javascript array?
What is array Concatenation method?



Explanation
Method: concat() :
        This function is used to concat two or more arrays into a single array. The concatenation function appends the second array with first array.

Syntax:
array1.concat(array2,array3,...arrayx);

Example Code:
<script language="javascript">
var alphabets = ["a", "b","c"];
var numbers = ["1", "2"];
var symbols = ["@", "$","^"];
var alphano = alphabets.concat(numbers,symbols);
document.write(alphano);
</script>


Result:

Thus, array concatenation can be carried out by using this function.





A Note
Javascript (JS) is one of the most used languages in the world. Some times spelled as Java Script. Hope you enjoy this tutorial. Do send your feedback or suggestions on this javascript or java script tutorial. This is a copyright content.

Other Links

web hosting